Display custom taxonomy posts of custom post types

Create taxonomy archives, not pages. Create three separate files called taxonomy-kind-websites.php taxonomy-kind-graphics.php taxonomy-kind-programming.php Displaying the items/posts as a list is pretty simple, eg <ul class=”my-posts”> <?php while ( have_posts() ) : the_post(); ?> <li><h2><a href=”https://wordpress.stackexchange.com/questions/102609/<?php the_permalink(); ?>” title=”<?php the_title_attribute(); ?>”><?php the_title(); ?></a></h2> </li> <?php endwhile; ?> </ul> You may also need to add the following … Read more

shortcode for recent custom type post

This seems to work with custom post type : function get_custom_posts( $params ) { extract( shortcode_atts( array ( ‘number’ => ‘1’, ‘excerpt’ => 290, ‘readmore’ => ‘no’, ‘cpt’ => ‘post’, ‘readmoretext’ => ‘Read more’ ), $params ) ); //$latest_posts = get_posts( ‘category=0&numberposts=” . $number . “&suppress_filters=false’); OLD $latest_posts = query_posts( ‘post_type=”.$cpt.”&posts_per_page=” . $number ); wp_reset_query(); … Read more

Repeatable custom meta select boxes

To make this work… $meta == $item->ID ? ‘ selected=”selected”‘ : ”; … with an array like a:1:{i:0;s:3:”179″;} which unserializes to… Array ( [0] => 179 ) … you’d need to do this: $meta = unserialize($meta); $meta[0] == $item->ID ? ‘ selected=”selected”‘ : ”; But that line shows up inside a foreach like foreach($meta as … Read more

Customizing the display of custom post types

This sounds quite a bit like the Advanced Custom Fields flexible content field. Basically it works by letting you setup a number of different templates for how you might want to create/display your page. Then when you are in the editor, you pick which template you want to use. More info here: http://www.advancedcustomfields.com/resources/field-types/flexible-content/

Custom Post Type Template based on Taxonomy

I’m afraid you have to do this manually. You can put someting like this in your single-vehicles.php file: if ( … ) { // check if it’s in used category/term get_template_part(‘part-single-vehicles-used’); } else { get_template_part(‘part-single-vehicles-new’); } And then put new car template into part-single-vehicles-new.php file and used car template into part-single-vehicles-used.php.