Custom Post Type conflicting with page?

Find the code where you register your portfolio post type and add/change this arguments: ‘has_archive’ => ‘work’, //under work you will see a list of portfolio items ‘rewrite’ => array( ‘slug’ =>’work_item’, ‘with_front’ => false, ), then manually go to Settings > Permalinks and refresh your permalink structure after that your items will be listed … Read more

portfolio custom type tags support

Just add this code under your category registration. Check the register_taxonomy() function for more details. Usually when you set hierarchical => true taxonomy looks like category and hierarchical => false its looks like tag. register_taxonomy(‘portfolio_tag’,’portfolio’,array( ‘hierarchical’ => false, ‘labels’ => array( ‘name’ => _x( ‘Portfolio Tags’, ‘taxonomy general name’, ‘flowthemes’ ), ‘singular_name’ => _x( ‘Portfolio … Read more

Custom post types with categories in template

<?php $args = array( ‘post_type’ => ‘cars’ ); // How can I add a category-filter to this? $args = array( ‘tax_query’ => array( array( ‘taxonomy’ => ‘Car-Types’, ‘field’ => ‘slug’, ‘terms’ => ‘Audi’ ) ) ); $loop = new WP_Query( $args ); while ( $loop->have_posts() ) : $loop->the_post(); echo ‘<li>’; the_title(‘<h3>’, ‘</h3>’); the_content(); echo ‘</li>’; … Read more

Running a wordpress action when a custom post type term (taxonomy category) is changed

‘set_object_terms’ is probably the hook you want. It gets passed the following: post_id, terms, term_taxonomy ids, taxonomy, append, old term_taxonomy ids. You can use the post_id and taxonomy params to determine if its the post type and taxonomy you want to hook into, and then check if term_taxonomy_ids differs from the old term_taxonomy_ids to decide … Read more