Tag Info

Hot answers tagged

9

You may be surprised, but there is nothing strange there. First of all let's clarify that in WordPress when you visit a frontend url you trigger a query. Always. That query is just a standard WP_Query just like the ones to run via: $query = new WP_Query( $args ); There is only one difference: the $args variable are generated by WordPress using the ...


2

You should wrap your enqueue/register function in your conditional, not your add_action() You can try something like this using the is_404() conditional check function enqueue_404_script() { if(is_404()) { //do what you need to do } } add_action( 'wp_enqueue_scripts', 'enqueue_404_script' );


2

It turns out that the nginx config that W3 Total Cache inserts if Disk Enhanced mode is enabled will break permalinks, but only if you restart nginx after W3 Total Cache injects the config for Disk Enhnaced mode. Based on birgire's suggestion, I turned off all plugins and checked the site, which started working correctly. I then turned on W3 Total Cache ...


2

You will want to run a find-and-replace script across the database to update all URLs to reflect the new domain. Just because you change the WordPress settings doesn't mean the content stored in the database has been updated with the new domain! I've had good luck with the Velvet Blues Update URLs plugin but you can also do this type of find and replace ...


2

I cracked it! In my case I first created an author.php page (my theme lacked one) from the archive.php by cloning and cleaning it. Then I found this piece of code: <?php if ( have_posts() ) : ?> It basically says: if the authors has published some posts, then... Well, I just added: "OR NOT!" <?php if ( have_posts() || !have_posts() ) : ?> ...


2

That is totally normal behaviour. If you want to remove category base you will need to write some custom rewrite rules, not simple rules I must say. From my point of view, removing category base requires a extra job in each request that is worthless because it doesn't provide any advantage for SEO or for better site navigation. Some popular plugins, like ...


1

There is 404.php in the theme uploaded. But when there is search for non-existent page. The 404.php does not show up. When there is search for non-existent page doesn't produce the 404 page, but simply shows the search.php's else portion. A simple search.php is like: <?php if( have_posts() ) : ?> <?php while( have_posts() : the_post(); ...


1

You can replace the broken functions.php file, recovering it from the original theme package. From the namespace of your error message I can guess that the theme you are using could be this: https://wordpress.org/themes/catch-box Right? I hope it helps.


1

When a URL is processed by Wordpress, its index.php script is loaded with the path to the requested page. Because in this case the index.php script is always found, a normal 404 error will never trigger (via ErrorDocument 404 …). If the requested URL does not match a page that WP knows about, WP will display its own "404" page. Unfortunately, if WP ...


1

There is currently a bug in the functionality that handles the NOBLOGREDIRECT constant, which causes 404 errors on the main site to be redirected to the value of the constant. Apparently this is the expected behaviour for sub-directory networks (example.com/subsite), but should not take place on subdomain networks (subsite.example.com). There is a WordPress ...


1

Do not use variable name "name" for html textbox control, use something else. This behavior is due to internal handling of WordPress with "name" variable found in query string of posted data.


1

After checking phpinfo(), mod_rewrite wasn't enabled so I enabled it: http://linuxcommando.blogspot.fr/2014/03/how-to-enable-modrewrite-for-apache-web.html and it worked !


1

Are you sure that you don't have a page with the same name of the custom post type? If you do, the permalink rewrite rules will get confused and trigger a 404. A very simple solution is: The page that lists the custom post types is called in plural (eg. products) and the actual post type name is in singular (eg. product). So they don't conflict and it's ...


1

When clicking on any of those links, redirecting to an URL like "root/category/post-name/", the 404 template is loaded, If you remove the category_template filter, are the links still 404? For categories, your cpt post should appear in the list of posts in that category. So the url is root/category/. When clicking on any of those cpt links, the ...


1

The problem your GET param is using the same name as the query var for your custom post type. $link = $link_aqui_se_sirve.'?'.$establecimientos_cpt_name.'='.$tax->slug; With that URL, WordPress is expecting the value of the $establecimientos_cpt_name parameter to be a post slug. Instead you are giving it a taxonomy slug. This will give you a 404 unless ...


1

Actually I got to the bottom of it. The problem was that I have installed the WPML plugin. But I forgot to install the WPML Media plugin. As soon as I installed it, the attachment pages started working again. In my opinion, this is unacceptable and I will escalate the issue to WPML team. If the Media plugin is so critical, it should be made obvious to the ...


1

In functions.php function productsPageRedirect_404() { global $post; if( is_page('products') ) { global $wp_query; $wp_query->set_404(); status_header(404); } } add_action( 'wp', 'productsPageRedirect_404' );


1

It is no only name or email problem, as Tom wrote. I had problem even with input field with name attribute same as one of my Custom Post Types. For example: ... <input type="text" name="movie"> ... And when having registered CPT "movie" somewhere else, your form submitting will end with 404 error. Conclusion: Don't use name, email and any ...


1

Just had exactly weird "from" word issue on a single post, and traced it to Wordpress SEO plugin by Yoast. It may be a sum of other causes for sure, as this got away so far up to this versions. Using the latest versions by now: Wordpress SEO plugin by Yoast, Version 1.6.3 Wordpress 4.0 Deactivating Wordpress SEO plugin, instantly allowed me to edit the ...


1

The first section of this question have been answered before. Basically, there are no index pages for archives, and there never will be. For a complete explanation, feel free to check this post I have recently done on this subject. Why did wordpress think that is post_name and post type is post? You might or might not know this, but Wordpress uses ...



Only top voted, non community-wiki answers of a minimum length are eligible