Custom post types, taxonomies, and permalinks

Change slug in your post type arguments to products/%product_cat%, and slug in your taxonomy arguments to just products, then flush your rewrite rules. WordPress should now handle /products/my-product-cat/post-name/! Now finally, we need to help WordPress a little with generating permalinks (out of the box, it won’t recognise the permastruct tag %product_cat%): /** * Inject term … Read more

How to get URL of current page displayed?

get_permalink() is only really useful for single pages and posts, and only works inside the loop. The simplest way I’ve seen is this: global $wp; echo home_url( $wp->request ) $wp->request includes the path part of the URL, eg. /path/to/page and home_url() outputs the URL in Settings > General, but you can append a path to … Read more

Permalinks in WordPress not working

Go to admin Click Settings Click Permalinks Select Post Name (for clean permalinks) or default Finally Click Save This rewrites .htaccess and wordpress permalinks may work in most cases if .htaccess is not created, make .htaccess with following can you also confirm mod_rewrite is enabled in your server?