-
AuthorPosts
-
September 9, 2013 at 10:22 pm #29334
Hello,
I’m running into a plugin issue and want to see if you can help me figure out what’s going on. I’m using Store Locator Plus and first reached out to the developer for paid support before coming here. I’m getting 404 errors for all the custom pages the plugin is creating (/doctors/###).
Is there a setting in the theme or a snippet of code I can add that will allow these custom pages to be created and displayed?
Here’s what the plugin developer said after spending a lot of time working on this:
Well… I am baffled now as well.
Something in the unique mix of plugins & theme feaures is breaking permalinks. I am certain of that.
I am also certain that the basic engine for Store Pages is working. Turn off permalinks and the problem goes away, but the URLs are ugly (and bad for SEO).
There are a LOT of custom rules in this theme that change the permalinks table. The WPML “submodule”, for example, adds custom slugs and rules for custom post types based on the primary language. It has a special handler for portfolio page types as well.
I am certain some combination of the plugins on the site are causing an issue. I’ve installed WordFence, SEO, and WPML on my dev box all with the PostName permalink structure with no problems.
Something is mangling permalinks but I do not know what. I would like to figure it out today but I need to address some SLP4 beta issues this evening & have a full agenda tomorrow morning with family stuff going on.
I will come back to this in the next 24h or so, but the first thing I think you should try is a restore of the backup to a clean staging/test site and start disabling the plugins until you are left with the base theme + Store Locator Plus / Store Pages + WPML. If that doesn’t work then building UP from a clean site, layering on the add-on packs starting with the base theme + SLP / Pages then the plugins in order of importance.
It could very well be an old configuration/option setting in the wp_options table that was not cleared out when upgrading. Maybe the theme on the live site or a plugin on the live site is reading an old/obsolete value. I’ve had that issue with my own plugins in the past and had to write specific upgrade/activation rules to remove or update obsolete options.
I’ll see what I can dig up, but thus far on my test system I’m coming up with nothing.
I’d start disabling all the plugins on the live site until it is just the base theme + Store Pages, but I don’t want to make the site go into FUBAR mode without your consent.
—
As a “sanity test”, and in hopes to possibly uncover the issue with the Enfold theme & the location pages I decided to leave Enfold installed and active as my default theme on my development system.
Tonight, with a clean install of WP3.6 + Enfold + Store Locator Plus plugins, some really odd things started happening. Most notably the infamous “Sample Page” that comes with all WordPress installs as the first page pre-installed…. went missing. I simply cannot get to it with Permalinks enabled and Post Name as my custom post type.
I do NOT have Store Pages enabled. Only Store Locator Plus 4 and Pro Pack 4. Neither one of those components go near the permalinks table.
For some reason after using the site for just over an hour, my previously working sample page just started coming up with 404 errors.
My dev system is on localhost, so it is not a DNS issue.
My access is basically “wide open”, meaning I am running in privileged mode (though not root/super user) so it is not a security issue.
My guess is the theme has completely FUBARed the permalinks data or interface.
I have put in literally HUNDREDS of hours with SLP4 + Pro Pack 4 on the included WordPress 3.6 theme as well as a custom theme for a client (120+ hours), Genesis (90+ hours), and a few other themes and have never seen this type of result before.
I recommend getting in touch with the theme author and asking if he has heard of this happening before. At first I was thinking “it must be something in Store Locator Plus or Store Pages”, but now that Sample Page with NO Store Locator Plus code has gone missing I’m fairly certain it is NOT something in the plugin.
I’m even more convinced of it as it happened with SLP4 which cleans up some script loading that was putting SLP scripts on pages without the locator map. That does not happen in SLP4, and I verified that was the case on the sample page URL.
I’ve even tried using another plugin that’s similar and I get the same issue.
Please let me know if you need logins, URLs or anything at all to help you help me.
I appreciate your support and understanding! Thanks in advance.
September 10, 2013 at 8:26 am #140393Tbh I don’t know why the plugin author claims things like “My guess is the theme has completely FUBARed the permalinks data or interface.”. Our theme does not rewrite the permalinks in general but only the permalink of the custom post type “portfolio” (registered in wp-contentthemesenfoldincludesadminregister-portfolio.php) uses a rewrite rule and the WPML rewrite rule the author mentions in his mail (probably he refers to the code in wp-contentthemesenfoldconfig-wpmlconfig.php) does not affect other post types too. Kriesi just rewrites the slugs for all post types which are stored in the $avia_config array and that’s actually just the portfolio post type (compare following line in wp-contentthemesenfoldincludesadminregister-portfolio.php)
$avia_config['custom_post']['portfolio']['args'] = $args;
Also the url rewrite just affects the portfolio post type – compare the code:
function avia_wpml_url_filter($lang)
{
$post_type = get_post_type();
if("portfolio" == $post_type)
{
$slug = avia_wpml_get_options('portfolio-slug');
$current = isset($slug[ICL_LANGUAGE_CODE]) ? $slug[ICL_LANGUAGE_CODE] : "";
foreach ($lang as $key => $options)
{
if(isset($options['url']) && $current != "" && $current != $slug[$key] && "" != $slug[$key])
{
$lang[$key]['url'] = str_replace("/".$current."/", "/".$slug[$key]."/", $lang[$key]['url']);
}
}
}
return $lang;
}If you still think our config.php breaks the permalink open up functions.php and replace
require_once( 'config-wpml/config.php' );
with
//require_once( 'config-wpml/config.php' );
Afterwards WP will complete ignore all WPML related rewrite rules which are part of the theme code and no other rewrite rules will be applied (by the theme) to the permalinks.
That said I didn’t notice any permalink issues with other plugins (WooCommerce & WPML or bbpress & WPML) and I agree with the author above – it’s probably a conflict in your configuration (plugin/plugin conflict or plugin/theme conflict). You can try to deactivate all plugins and then activate them one by one to find the conflicting plugin(s).
September 19, 2013 at 5:31 am #163377Dude,
Thanks for the help. I like the new site!
After poking around for quite some time, I was able to get the pages to work. I’m still not sure what was breaking them, as I can’t pinpoint any one thing. The theme and plugins have been working great as I started building from a fresh install. Then today, I ended up taking another shot at finding something that would let the current site continue on. It’s a pretty complex site in areas, so rebuilding was looking like a huge job.
Anyways, here’s what got it to work. I added this to functions.php:
add_action(‘init’, ‘custom_taxonomy_flush_rewrite’);
function custom_taxonomy_flush_rewrite() {
global $wp_rewrite;
$wp_rewrite->flush_rules();
}I hope this isn’t a bad fix. At least it’s working. I’d love to hear your thoughts on this solution and if I could have done anything else.
Thanks again for your support!
September 19, 2013 at 8:19 am #163428Hi!
Not at all :) – we use the flush_rules(); method on the option page too – otherwise the user wouldn’t be able to change the single portfolio item slug without flushing the permalinks manually (Settings > Permalinks).
Cheers!
Peter -
AuthorPosts
- The topic ‘Custom post type/category/taxonomy pages giving 404 – ENFOLD’ is closed to new replies.