• Resolved Mohit

    (@themohityadav)


    I am using same category for each type of posts (WPCore Taxonomies), but wp default posts are showing in public taxonomy url, but custom posts from cptui is not showing in same public taxonomy url. but custom posts working fine.

    Page Attribute Function is not allowing me to change the page template, it is showing numbering sequence only. images are given below:

    • This topic was modified 1 year, 7 months ago by Mohit.
Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter Mohit

    (@themohityadav)

    Adding all CPTUI post types to the archives beacuse WordPress does not include custom post types in the archives, paste this code in functions.php

    function my_cptui_add_post_types_to_archives( $query ) {
    	// We do not want unintended consequences.
    	if ( is_admin() || ! $query->is_main_query() ) {
    		return;    
    	}
    	if ( is_category() || is_tag() && empty( $query->query_vars['suppress_filters'] ) ) {
    		$cptui_post_types = cptui_get_post_type_slugs();
    
    		$query->set(
    			'post_type',
    			array_merge(
    				array( 'post' ),
    				$cptui_post_types
    			)
    		);
    	}
    }
    add_filter( 'pre_get_posts', 'my_cptui_add_post_types_to_archives' );

    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    @themohityadav I see you marked the thread as resolved, did you get all your questions handled? or do you have any lingering questions?

    Thread Starter Mohit

    (@themohityadav)

    By searching support forum, my problem was solved. Thanks

    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    Awesome.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Post is not showing in Taxonomies public url Using WpCore Taxonomies’ is closed to new replies.