We're merging with GenerateBlocks! Learn more here.

Support Forum

Please login to receive premium support.

Support for the free plugin can be found here.

Home Forums Pro Support Filtering category views to showpost pages Reply To: Filtering category views to showpost pages

#10663
Tom
Keymaster

Ah, good point.

I wonder if this would work?:

add_filter('request', function( array $query_vars ) {
    if ( is_admin() ) {
        return $query_vars;
    }

    if ( isset( $query_vars['category_name'] ) ) {
        $pagename = $query_vars['category_name'];

        if ( get_page_by_title( $pagename ) ) {
            $query_vars = array( 'pagename' => "$pagename" );
        }
    }

    return $query_vars;
} );

Let me know 🙂