WordPress.org

Ready to get started?Download WordPress

Forums

post and custom post type listing (1 post)

  1. jankowalski
    Member
    Posted 1 year ago #

    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?

Topic Closed

This topic has been closed to new replies.

About this Topic