October 22, 2015 at 10:27 AM #35139
I’ve got the store pages permalink setup to be start with “locations”. So the URLs are working fine like:
/locations/store-1/, /locations/store-2/, etc/
I tried creating a page with a permalink of /locations/ and added the [SLPLUS] shortcode. However my map page 404s after I save and load it.October 22, 2015 at 10:42 AM #35141
Like it works if I change the page slug to “test-page”, but I’d like the URL hierarchy to make sense if I can. I understand development, so if it’s not a feature of the plugin UI but can be done, that would be helpful.October 22, 2015 at 2:46 PM #35158
Also I was wrong. It doesn’t throw a 404. It returns status 200, however it’s loading my index.php and not my page.php file. The have_posts() method returns false in the index.php, which is why I get the Page not found warning.October 22, 2015 at 5:00 PM #35167
You need to provide information abut your SLP environment to get a correct answer. You find it under SLP > Info > Plugin Environment tab. Read more on the forum guide.
I had a similar problem when setting up Pages and the short answer is “no you cant have the same name” as you describe. I had a conflict with the URL hierarchy so I needed to change this to another.October 23, 2015 at 12:24 PM #35183
I am actually able to get the same /locations/ permalink working for the map page that matches the Store Pages as well. The only problem I am trying to figure out now is why the meta data from Yoast (title & meta desc aren’t loading properly). From what I can tell, on page load, WordPress thinks the page is an archive, even though it’s post_type in the DB and on query is = ‘page’. Some weird piece of meta data is labeling it as an archive page, so my meta description doesn’t show up, and the title is “Pages – My Test Domain”October 23, 2015 at 12:33 PM #35184
Yes, this is the behaviours that is happening for me too when trying using the same. Maby Lance can explain in more detail what is happening “under the hood” to use this properly. I just changed it to a similar but different name to solve it quick so I cant help you more for now.October 23, 2015 at 5:28 PM #35191
So this is what I did to get it to work. Keep in mind, I haven’t tested this 100% to make sure it didn’t mess up any other pages on my site.
I hooked into these two plugin filters:
add_filter(‘slp_storepage_attributes’, array($this, ‘remove_rewrite_slug’));
add_filter(‘slp_results_marker_data’, array($this, ‘modify_store_page_url’));
On the first, I removed the rewrite parameter from the array. On the second, I do a string replace on any array element that is a URL from store_page to locations.
Then finally I implemented two new rewrite rules to handle the map page and store page requests. So far, it looks like it works. But again, this is not fully tested that it doesn’t break anything else or accepts URL parameters, etc.
$rules = array(
‘locations/(.+?)/?$’ => ‘index.php?store_page=$matches’,
‘locations/?$’ => ‘index.php?pagename=locations’,
);October 28, 2015 at 3:30 PM #35335
There is a page user who posted in the forums, I have tried to give him suggestions, I am not sure if his issues are with Pages or WPML translations or Templates or all. I mentioned searching the forums for answers. Also his posted screenshot of his page template doesnt look right to me, but what do I know…
If either of you have suggestions , or the time , to help him could you?
His post is here
You must be logged in to reply to this topic.