Teasers – full width?

Community Forums Forums Design Tips and Tricks Teasers – full width?

This topic is: not resolved

Tagged: ,

This topic contains 2 replies, has 2 voices, and was last updated by  JoggingLife 11 months, 4 weeks ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #61284

    JoggingLife
    Participant
    Post count: 7

    Hi all,

    I want to add a 320 x 50 mobile banner to my website, situated before my post titles.

    I found a way to do this, but it added the banner to the grid loop, so the ad shows on the homepage and archives rather than just in the post itself. You can see this on my site, here: http://thegoldfishtank.com

    I wouldn’t mind this – in fact it could be a good thing – but because the teasers are two columns, two banners show next to each other and overlap slightly.

    So, could anyone tell me how to:

    a) Make the teasers full width so that there’s only one per row in the middle column?

    or

    b) Make the ad only show once, in the first post of the grid loop?

    or

    c) Add the ad before my post title, but not have it show in the grid loop?

    As you can probably tell, coding/HTML isn’t my strong point so I’d really appreciate any fairly straightforward and clear instructions!

    Thanks in advance.
    Adam

    http://thegoldfishtank.com
    #61305

    braddalton
    Participant
    Post count: 9413

    Try this:

    Please copy the code from the view raw link and paste it at the end of your child themes functions.php file using a text editor like Notepad++

    Or you can display the mobile banner using the genesis_before_loop hook.

    Another option is to use a conditional tag for mobiles if you only want your banner to displays when viewed on mobile devices.

    You can set the the posts per page to the same number as the features in your home.php file:
    [php]
    remove_action( ‘genesis_loop’, ‘genesis_do_loop’ );
    add_action( ‘genesis_loop’, ‘child_grid_loop_helper’, 55 );
    /** Add support for Genesis Grid Loop **/
    function child_grid_loop_helper() {

    if ( function_exists( ‘genesis_grid_loop’ ) ) {

    genesis_grid_loop( array(
    ‘features’ => 5,
    ‘feature_image_size’ => 250,
    ‘feature_image_class’ => ‘alignleft post-image’,
    ‘feature_content_limit’ => 1000,
    ‘grid_image_size’ => ‘grid’,
    ‘grid_image_class’ => ‘alignleft post-image’,
    ‘grid_content_limit’ => 220,
    ‘more’ => __( ‘Continue reading…’, ‘genesis’ ),
    ‘posts_per_page’ => 5,
    ) );

    }

    else {
    genesis_standard_loop();
    }

    }

    genesis();
    [/php]

    Or you can remove the grid loop and only use the standard loop.


    Specializing In StudioPress Child Theme Customization.
    500+ StudioPress Tutorials

    #61328

    JoggingLife
    Participant
    Post count: 7

    Awesome, thanks a lot for this! I tried both of the first two options and have gone with the genesis before loop hook for now.

    Thanks again for taking the time to help.

    Adam

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

You must be logged in to reply to this topic.