Articles of custom post types

Using WP_Query, I want to show posts that are associated with a custom taxonomy term

I have a custom post type called event. Custom taxonomy called event categories, which has various terms. I want to show all the events that belong to a certain custom taxonomy term on a archive page. I am including the custom taxonomy term wrongly, as it displays all the events and not just ones that […]

Custom Post Type homepage template

This is what I want: I have made a Custom Post Type in my theme and it shows in my home too, but the problem is that tha CPT takes the same elements and style of a default post in WordPress, how I can assign a template for how my CPT is displayed at my […]

Query only current post type using taxonomy

I have several post types “Courses”, “Institutes” having same taxonomy “country”. I am using this to get term on single-courses.php <?php $terms = get_the_terms( $post->ID , ‘country’ ); foreach ( $terms as $term ) { $term_link = get_term_link( $term, ‘country’ ); if( is_wp_error( $term_link ) ) continue; echo ‘<a href=”‘ . $term_link . ‘”>’ . […]

Create custom WP_List_Table in post_type

I have a post type named “case”. I want to create a “Sub-page” to list only my “cases”. And add some custom HTML (search box, some labels, logos, etc..) Anyone knows how can I do this? Code to create the post_type. function my_custom_post_type_case() { $labels = array( ‘name’ => _x( ‘Cases’, ‘post type general name’ […]

Can't replace the default sidebar with a custom sidebar on Custom Post Type in Genesis

I have an archive template (“archive-reviews.php”) for a Custom Post Type I have created. I’d like to replace the default archive sidebar with a different one that I have created using the Genesis Simple Sidebars plugin. The code I am using in the template file to do this is as follows: remove_action(‘genesis_sidebar’, ‘genesis_do_sidebar’ ); add_action( […]

Admin search ACF relationship

I have a custom post type name story. It has a custom field named ‘select_artist’ with a relationship to a custom post type named artist. Within the story edit page, I want to use the search box to search for the ‘select_artist’ title. At the moment it will only return results when I search for […]

flush_rewrite_rules on every register_post_type?

I’m stuck in an awful situation and I think it’s because I’ve registered 5 post types but calling flash_rewrite_rules() function just once, so I have this question: Should I call flash_rewrite_rules() function after each registration of custom post type or just one call? And by the way, is it OK to have 10 custom post […]

Modifying date filter on admin page for custom post type to link to custom field

Apologies if a similar question has already been asked, but I can’t seem to find the exact functionality I am looking for. Basically I have a custom post type (sermons) which has ‘recorded_date’ as a custom meta data field. What I would like to do is on the custom post admin page (where all posts […]

Custom posts – tag pagination

I’m using the following code to output the custom posts that belongs to a tag: add_filter(‘pre_get_posts’, ‘query_post_type’); function query_post_type($query) { if(is_category() || is_tag() && empty( $query->query_vars[‘suppress_filters’] ) ) { $post_type = get_query_var(‘post_type’); if($post_type) : $post_type = $post_type; else: $post_type = array(‘btp_work’); // replace cpt to your custom post type $query->set(‘post_type’,$post_type); endif; return $query; } } […]

Modifying WP_Title For Custom Post Type

Trying to modify the output of the WP_Title through a custom post type with a filter. I’ve had no issues doing it to the_title but I assume as the wp_title function is called through the header it’s the problem and I’m missing something simple. What I want to do is change the output of the […]