Forum Replies Created

Viewing 1 replies (of 1 total)
  • Hi @tw2113 !

    I’m so glad I found someone who knows how to address this issue 😀

    I have essentially the same problem whereby I am trying to create an Author Archive Page in which CPTs will be drawn in.

    I have copied in the exact code as given above into my functions.php folder, however unfortunately I haven’t had success.

    My CPT slug is ‘offers’ and I have inputted this into the array feild as required:
    function wpse107459_add_cpt_author( $query ) {
    if ( is_admin() || ! $query->is_main_query() ) {
    return;
    }

    if ( $query->is_author() ) {
    $query->set( ‘post_type’, array( ‘offers’ ) );
    }

    }
    add_action( ‘pre_get_posts’, ‘wpse107459_add_cpt_author’ );

Viewing 1 replies (of 1 total)