WordPress Rewrite Issue

The rewrite rules are wrong. For example, you want to rewrite from community/tag/easter to ‘index.php?pagename=community&stencil-tag=easter’, so the regex should contain community/tag/ and not only tag/. Also, \d match only digits but the tag value is a string. Same apply to the rewrite for stencil-tag. You could use . to match any character, both numeric and … Read more

How to create TEMPLATES for TAXONOMIES? What I have to change in this code?

I used: $args = array( … ‘rewrite’ => array( ‘slug’ => ‘portfolio-taxonomies’ ), … ); register_taxonomy( ‘portfolio_taxonomies’, array(‘portfolio’), $args ); So my URL is predictable. And you did one thing wrong, URL you are putting is NOT correct. If the rewrite rule is implemented, then they would be: http://localhost/wp-test/portfolio-taxonomies/taxtemp1/ http://localhost/wp-test/portfolio-taxonomies/taxtemp2/ To grab the correct URL, … Read more

How to pass taxonomy terms to WP_Query along with $args?

You can do like following $thiscat = $wp_query->get_queried_object();//put this code $args = array( ‘post_type’ => ‘sports’, ‘tax_query’ => array( array( ‘taxonomy’ => ‘sports_category’, ‘field’ => ‘slug’, ‘terms’ => $thiscat->slug // Pass this to slug ), ), ); $myquery = new WP_Query($args); then you can able to fetch post titles tagged under football and basketball separately … Read more

WordPress Taxonomy Permalinks – Custom?

Natively every post in WordPress has one specific permalink (if any and not counting non–pretty arguments–based shortlinks). This makes sense not just to WordPress, but also to other entities like people and search engines. It is certainly possible to make additional URLs to load posts in WP too. However it won’t help you any with … Read more