Forum Replies Created

Viewing 1 post (of 1 total)
  • Author
  • in reply to: Custom post author’s archive URL discrepancy in Kleo #92111
     leloosh
    Participant

    Thanks Andrei,

    This is the code I used from your link referral:

    COPY CODE
    function custom_post_author_archive($query) {
        if ($query->is_author)
            $query->set( 'post_type', function custom_post_author_archive($query) {
        if ($query->is_author)
            $query->set( 'post_type', array('wp_plugin_review', 'client', 'post') );
        remove_action( 'pre_get_posts', 'custom_post_author_archive' );
    }
    add_action('pre_get_posts', 'custom_post_author_archive'); );
        remove_action( 'pre_get_posts', 'custom_post_author_archive' );
    }
    add_action('pre_get_posts', 'custom_post_author_archive');

    I want to display the author archive who uses a custom post type “submit-post” as slug, so I think I replaced in the code array(‘wp_plugin_review’, ‘client’, ‘post’) with submit-post.

    Is that similar to what you did?

Viewing 1 post (of 1 total)

Log in with your credentials

Forgot your details?