hide old events custom post type

Your main issue is here is date formatting. Although the other answer will work, it is ineffecient and will cause inconsistant amount of posts per page in paginated queries. The issue here is, if you have 100 posts and only 10 has a date in future, you are wasting a lot of resources querying an …

Read more

Dropdown switching subcategories portfolio

The ‘child_of’ argument lets you select subcategories from a parent category, and a you can get the current taxonomy id to pass as the value: <?php $category_id = get_queried_object_id(); $args = array( ‘hide_empty’=>1, ‘depth’=>1, ‘hierarchical’=> 0, ‘show_count’=> 1, ‘taxonomy’=> ‘portfolio-types’, ‘child_of’ => $category_id ); ?> <ul> <?php wp_dropdown_categories( $args ); ?> </ul> So in the …

Read more

template structure for CPT not clear

Sorry I was using wrong structure, after looking through a bit more i found out exact difference for CPT and cutom taxonomies. For custom post types the template structure is like:-\ single-{post-type}.php archive-{post-type}.php search.php index.php And for Custom taxonomies, the template structure I found out from here:- Link:-Templates for Custom Post Types and Custom Taxonomies