• Resolved zulok

    (@zulok)


    Hi

    First of all, apologies if this has been answered before however I have been searching for 2-3 hours in the WP Support unsuccessfully.

    I have several CPT that represent different types of agenda items (event, trainings, workshops…) and I would like to display all of them as an Archive template from a single menu item that it is neither the front page, neither the blog page.

    As submenus of this one, there would be a link to each CPT subtype sluc (I know how to do this). But at first navigation level of the menu I would like to see a mix of all CPT’s together.

    Here is what I want to do

    1) Menu Item 1
    2) Menu Item 2
    3) Menu Agenda -> Resolves to an archive page showing cpt1 & cpt2 & cpt3
    3.1) Events CPT1 -> mysite.com\cpt1
    3.2) Trainings CPT2 -> mysite.com\cpt2
    3.3) Workshops CPT3 -> mysite.com\cpt3
    4) Menu Item 4
    5) Menu Item 5

    Thanks

    Zulok

    PS: BTW, I am using pre_get_posts to sort CPTs by a date that is stored in postmeta

Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator bcworkz

    (@bcworkz)

    Probably the easiest way to show all posts of various types from a menu item link is to create a custom page template that makes a custom WP_Query and loops through the results instead of showing the usual page content. Then create a page based on this template, which is what you link to in the menu.

    The WP_Query arguments need to include the ‘post_type’ argument with an array of desired post types.

    Thread Starter zulok

    (@zulok)

    Thank you bcworkz

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Multiple CPT under one single menu entry point’ is closed to new replies.