pre_get_posts hook ignored?
-
I’ve set two custom post types to use as rewrites… It seems to be ignored by the Guten Post Layout PlugIn (others use it). Any idea, why?
function tabula_query( $query ) { global $post; if( 'favbooks' === $query->get( 'post_type' ) ) { $query->set( 'post_type', 'books'); $query->set( 'relationship', array( 'id' => 'tabula_lieblingsbuch_team', 'to' => $post->ID, ) ); } elseif ('recommendbooks' === $query->get('post_type') ) { $query->set( 'post_type', 'books'); $query->set( 'relationship', array( 'id' => 'tabula_empfehlung_team', 'to' => $post->ID, ) ); } } add_action( 'parse_query', 'tabula_query', 10, 1 );
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘pre_get_posts hook ignored?’ is closed to new replies.