Include Custom Post Type to Archive-Query

https://wordpress.stackexchange.com/a/154750


add_action( 'pre_get_posts', function ( $query ) 
{
  if (    !is_admin() 
       && $query->is_main_query() 
       && $query->is_archive()
   )
     $query->set( 'post_type', array( 'post', 'ausstellungen' ) );
}); 

SEARCH THIS

SHARE THIS

Share on email
Share on telegram
Share on print
Share on facebook
Share on google
Share on twitter
Share on pocket

DID YOU KNOW?

By clicking on the title in the upper right corner you can share this page
Try it! It’s easy.