Display taxonomy term slugs

You code is completely wrong. array_shift should not be used array_shift() shifts the first value of the array off and returns it, shortening the array by one element and moving everything down. All numerical array keys will be modified to start counting from zero while literal keys won’t be touched. You should have a look … Read more

How to change permalinks to taxonomy and post type’s posts

Go to the permalinks setting in the wordpress settings page and change the permalink structure to this. https://mysite.com/%category%/%postname%/ And now add this code in your .htaccess file to achieve that permalink structure. <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ – [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d

List all posts from custom post type by taxonomy

You could try this way. Create a new page called say ‘All products’ and apply the following template to it. Here is the code for that should be used in your template, just above the while loop. $type=”products”; $args=array( ‘post_type’ => $type, ‘post_status’ => ‘publish’, ‘posts_per_page’ => -1, ‘caller_get_posts’=> 1 query_posts($args); A complete sample template … Read more

Page displaying 1st post from a range of custom tax?

If I got it well, something like snippet below should would do what you want. I assume there are four items in your ‘gallery-area’ taxonomy and that the class you apply to your div has to vary accordingly (i.e. span_1_of_4 has to become span_2_of_4, etc.). <?php $gt_args = array(‘fields’ => ‘ids’); $terms = get_terms(‘gallery-area’, $gt_args); … Read more