WordPress.org

Support

Support » How-To and Troubleshooting » post and custom post type listing

post and custom post type listing

  • i have included custom post types to display on my home page loop using function

    function my_get_posts( $query ) {
    
    if ( is_page( 'not-here' ) )
         return $query;
    
    if ( ( is_home() && $query->is_main_query() ) || is_feed() )
    $query->set( 'post_type', array( 'post', 'videos', books', 'movies' ) );
    
    return $query;
    }

    Now i can display my custom posts types by

    mysite.com/books for books
    mysite/videos for videos
    mysite/movies for movies

    But i still don t know how to display only posts loop?
    mysite.com/posts give 404 error.

    any helping hand how to do that?

  • The topic ‘post and custom post type listing’ is closed to new replies.
Skip to toolbar