WooCommerce return 404 on category pages
Under Custom Base where you have used /shop/%product_cat% needs to be replaced with /shop/%product-category% Please see screenshot below:
Under Custom Base where you have used /shop/%product_cat% needs to be replaced with /shop/%product-category% Please see screenshot below:
Note: we’re talking here about the difference between permalinks /%ID%/%name%/ and %/name/%. It would be a whole different story if we were to compare /%ID%/%name%/ and %/ID/%. Now, there are two use cases that affect performance: One. You have a permalink and WP needs to resolve it in order to serve the page requested. This … Read more
Assuming your custom taxonomy is called artist (and you don’t override the slug in the rewrite parameter) you can use the rewrite tag %artist%. WordPress implements almost every functionality to use those rewrite tags in post permalinks. There are only a few small adaptations necessary. Building the Permalink First, you’ll need to use the post_link … Read more
The reason that’s happening at all is because of content negotiation. /2011.html wouldn’t normally be accessible through /2011/, but content negotiation is making Apache automatically look for files named 2011 (whatever the extension) when it can’t find the folder before it passes control to WordPress. This can be quite useful, but if you don’t particularly … Read more
The custom permalink field on the settings->permalink screen only applies to Posts. Not to Pages. WordPress Pages always live at the “top” of the URL tree. /about /whatever /etc. Posts live wherever the custom permalink string defines them to be. So, in your case, your permalinks custom structure would be “/news/%postname%/” and would not affect … Read more
One possible solution is to not change the category base and leave as-is, but instead modify any output of a category link to strip the category base via a filter. This of course will result in a 404 if you haven’t created a page in place of where these links point, so creating a page … Read more
Every time while you create new post type with code (plugins do that automatically) you have to rebuild/update you permalink on Settings – Permalink.
The procedure is thoroughly documented in Codex under Moving a Root install to its own directory. You misunderstand the point about changing URLs in it, and yes the terminology sucks. The only URLs that will change are those that are based on the “WP address”. That would be WordPress core, essentially the admin area. All … Read more
Within the wp_unique_post_slug function, checks are made to “Prevent new post slugs that could result in URLs that conflict with date archives.” Here’s the relevant code from line 3812 from wp-includes/post.php // Prevent new post slugs that could result in URLs that conflict with date archives. $post = get_post( $post_ID ); $conflicts_with_date_archive = false; if … Read more
Nothing. get_permalink() is the original function, and is used to get the permalink URL for a post. get_the_permalink() was introduced in 3.9 simply so the permalink function was consistent with the other post-related template tags, such as get_the_title(), get_the_content(), which are all prefixed with get_the_. The equivalent functions for echoing the result of those functions … Read more