Eleven40 Home/Blog issue (controlling #/format of posts)

Community Forums Forums General Discussion Eleven40 Home/Blog issue (controlling #/format of posts)

This topic is: not resolved

This topic contains 1 reply, has 2 voices, and was last updated by  essaysnark 1 year ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #30994

    seanb
    Participant
    Post count: 1

    decahedralist.com is the URL

    I need to do 2 things:

    I want to have the homepage include the most recent, entire blog post and a link to readmore. No more small posts below the most recent post.
    I want the Blog link to link to the blog page. On the blog page I want to have 5 most recent, entire posts (not the shortened posts)

    Right now I went to  Settings > Reading and chose Static Homepage: Select, Posts Page: Blog

    #31682

    essaysnark
    Participant
    Post count: 266

    StudioPress Support emailed me the code below to handle your first request re: the home page  – put it in functions.php, change the “5″ to “1″ and it should work (Settings -> Reading probably needs to be “Your latest posts”, not a static page.)


    add_action( 'pre_get_posts', 'child_change_home_query' );
    /** Changes the query on the home page*/
    function child_change_home_query( $query ) {
    if( $query->is_main_query() && $query->is_home() ) {
    $query->set( 'posts_per_page', '5' ); //change this value to match the posts per page value you wish to show on the home page
    }
    }

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.