Featured Posts Only Showing On First Page

Community Forums Forums Design Tips and Tricks Featured Posts Only Showing On First Page

This topic is: resolved

This topic contains 6 replies, has 2 voices, and was last updated by  cehwitham 1 year, 4 months ago.

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #22205

    dave_s
    Participant
    Post count: 26

    I’m tinkering about with Balance and Eleven40 theme on my localhost setup.

    I’ve set featured posts to 6 in home.php and ‘Number of Posts to Show‘ is set to 6 in Genesis settings.

    I get 6 featured posts on the home page but on all others they are teasers. It’s the same on both Balance and Eleven40. If I switch to MetroTheme it’s fine.

    Any ideas?

    Cheers

    Dave

    #22225

    cehwitham
    Participant
    Post count: 396

    Is it the category archive pages you’re not getting features on?

    The code to output the featured items is the following found in home.php of the eleven40 theme.

    remove_action( 'genesis_loop', 'genesis_do_loop' );
    add_action( 'genesis_loop', 'eleven40_grid_loop_helper' );
    /** Add support for Genesis Grid Loop */
    function eleven40_grid_loop_helper() {
    if ( function_exists( 'genesis_grid_loop' ) ) {
    genesis_grid_loop( array(
    'features' => 1,
    'feature_image_size' => 0,
    'feature_image_class' => 'alignleft post-image',
    'feature_content_limit' => 0,
    'grid_image_size' => 'grid-thumbnail',
    'grid_image_class' => 'alignnone',
    'grid_content_limit' => 250,
    'more' => __( '[Continue reading]', 'genesis' ),
    ) );
    } else {
    genesis_standard_loop();
    }
    }

    To get this layout on the category pages you’d need to duplicate home.php and rename it category.php so that this code runs on category pages and not just on the homepage.


    Twitter: cehwitham Web: cehwitham.com

    #22237

    dave_s
    Participant
    Post count: 26

    No, at least I don’t think so :)

    The home page is set to show latest posts

    When I scroll down to the bottom of the home page and click on previous all the posts on that page are shown as teasers.

    The home.php in Balance shows this:

    remove_action( 'genesis_loop', 'genesis_do_loop' );
    add_action( 'genesis_loop', 'child_grid_loop_helper' );
    /** Add support for Genesis Grid Loop **/
    function child_grid_loop_helper() {

    if ( function_exists( ‘genesis_grid_loop’ ) ) {

    genesis_grid_loop( array(
    ‘features’ => 6,
    ‘feature_image_size’ => 0,
    ‘feature_image_class’ => ‘align none post-image’,
    ‘feature_content_limit’ => 0,
    ‘grid_image_size’ => ‘grid’,
    ‘grid_image_class’ => ‘align none post-image’,
    ‘grid_content_limit’ => 0,
    ‘more’ => __( ‘Continue reading…’, ‘genesis’ ),
    ‘posts_per_page’ => 6,
    ) );

    }

    else {
    genesis_standard_loop();
    }

    }

    #22241

    dave_s
    Participant
    Post count: 26

    The above should read as follows. Couldn’t figure out how to set the code tag!!

    remove_action( ‘genesis_loop’, ‘genesis_do_loop’ );
    add_action( ‘genesis_loop’, ‘child_grid_loop_helper’ );
    /** Add support for Genesis Grid Loop **/
    function child_grid_loop_helper() {

    if ( function_exists( ‘genesis_grid_loop’ ) ) {

    genesis_grid_loop( array(
    ‘features’ => 6,
    ‘feature_image_size’ => 0,
    ‘feature_image_class’ => ‘align none post-image’,
    ‘feature_content_limit’ => 0,
    ‘grid_image_size’ => ‘grid’,
    ‘grid_image_class’ => ‘align none post-image’,
    ‘grid_content_limit’ => 0,
    ‘more’ => __( ‘Continue reading…’, ‘genesis’ ),
    ‘posts_per_page’ => 6,
    ) );

    }

    else {
    genesis_standard_loop();
    }

    }

    #22308

    cehwitham
    Participant
    Post count: 396

    It sounds like an issue with the paging. Without being able to look at your site, it’s difficult to know what’s going on.

    The following articles might help you out:

    http://www.billerickson.net/code/pagination-in-a-custom-query/

    http://www.billerickson.net/code/grid-loop-with-features-teasers/


    Twitter: cehwitham Web: cehwitham.com

    #23009

    dave_s
    Participant
    Post count: 26

    Figured it out… eventually!

    Commented out the grid loop function in home.php

    #23352

    cehwitham
    Participant
    Post count: 396

    Thanks for feeding back Dave, glad you got it sorted.


    Twitter: cehwitham Web: cehwitham.com

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

The topic ‘Featured Posts Only Showing On First Page’ is closed to new replies.