Widget area below featured article in eleven40

Community Forums Forums Design Tips and Tricks Widget area below featured article in eleven40

This topic is: not resolved

This topic contains 9 replies, has 2 voices, and was last updated by  braddalton 4 months, 3 weeks ago.

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #112789

    michaeloeser
    Member
    Post count: 5

    Hi everyone,

    I wonder how I can place a widget area right below the first (featured) article on the grid homepage of eleven40. I have one featured article followed by a two-column grid. I like the widget area display right after the frist article.

    I know how to setup widget areas and how to implement them in general but I can´t find a way to integrate a widget area after the featured article in eleven40. I assume there must be a hook or filter but I haven´t found it.

    Cheers
    Michael

    #112792

    braddalton
    Participant
    Post count: 10587

    You can hard code it into the front-page.php file or hook it in using a custom function. http://wpsites.net/web-design/adding-new-widget-areas-in-studiopress-themes/


    #112795

    michaeloeser
    Member
    Post count: 5

    Hi Brad,

    thanks for the quick reply. That´s exactly what I thought I should do but I´m confused. See the code of my child themes home.php

    <?php
    
    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'		=> 'thumbnail',
    			'grid_image_class'		=> 'alignleft',
    			'grid_content_limit' => 150,
    			'more' => __( '[Continue reading]', 'genesis' ),
    	) );
    	} else {
    		genesis_standard_loop();
    	}
    
    }
    
    genesis();

    Where should I add it? And I didn´t find a proper hook for this. Any hints?

    Thanks
    Michael

    #112796

    braddalton
    Participant
    Post count: 10587

    Before the closing genesis(); tag

    No need for a conditional tag.

    Also, the first part of the code to register the widget goes in your functions file.


    #112797

    michaeloeser
    Member
    Post count: 5

    Hmmm…not quite. When I do this in home.php

    <?php
    
    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'		=> 'thumbnail',
    			'grid_image_class'		=> 'alignleft',
    			'grid_content_limit' => 150,
    			'more' => __( '[Continue reading]', 'genesis' ),
    	) );
    	} else {
    		genesis_standard_loop();
    	}
    
    }
    
     function eleven40_after_featured() {
       genesis_widget_area( 'ad-homepage-only', array(
           'before' => '<div class="ad-homepage-only widget-area">',
       ) );
    }
    
    genesis();

    It displays the widget area before the first (featured) post. I want it right after this post.

    Ideas?

    #112802

    braddalton
    Participant
    Post count: 10587

    Wheres the add_action for this function eleven40_after_featured() {

    You will need to add all the code in your functions file and use a counter to output the widget after the 1st post in the loop

    http://wpsites.net/web-design/add-content-after-any-number-of-post-excerpts-in-any-type-of-archive/


    #112813

    michaeloeser
    Member
    Post count: 5

    Awesome. Works now. But the genesis_after_entry hook seems to be invalid. I used genesis_after_post_content and it works.

    Thanks
    Michael

    #112832

    braddalton
    Participant
    Post count: 10587

    Are you running HTML 5 or XHTML markup?


    #112833

    michaeloeser
    Member
    Post count: 5

    Still XHTML on this site

    #112843

    braddalton
    Participant
    Post count: 10587

    That’s why the hook didn’t work because its the new HTML 5 loop hook http://my.studiopress.com/docs/genesis-loop-hooks-comparison/


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

You must be logged in to reply to this topic.