Ambiance Pro – Widget area over featured image on single post/page

Community Forums Forums Design Tips and Tricks Ambiance Pro – Widget area over featured image on single post/page

This topic is: not resolved

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

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

    GK
    Member
    Post count: 8

    LOVE this theme, absolutely fantastic work again by Studiopress. I would however like to place a widget area over the featured image at the top of any given single post or page. So far I have:

    Registered the widget area in the functions file:

    genesis_register_sidebar( array(
    	'id'          => 'play-widget',
    	'name'        => __( 'Play Widget', 'ambiance' ),
    	'description' => __( 'This is the Play Widget area.', 'ambiance' ),
    ) );

    Added the action:

    //* Hook new widget area
    add_action( 'genesis_after_header', 'ambiance_entry_background' );
    function ambiance_entry_background() {
    
    	if ( is_singular( 'post' ) || ( is_singular( 'page' ) && has_post_thumbnail() ) ) {
    
    		echo '<div class="new-widget"></div>';
    	}
    
    }

    And created a little CSS in anticipation of it working.

    I cannot provide a link, apologies. Here is a mock up of what I am trying to achieve however:

    https://drive.google.com/file/d/0B-ziTKv-1wdZN0hQczc4b00zNms/edit?usp=sharing

    Am I even close??

    • This topic was modified 4 months, 3 weeks ago by  GK.
    • This topic was modified 4 months, 3 weeks ago by  GK.
    #102966

    Lauren @ OnceCoupled
    Member
    Post count: 608

    To hook the widget area in, you need a different function.

    Eg, mine looks like:

    add_action( 'genesis_after_sidebar_widget_area', 'widget_left_sidebar', 7 );
    function widget_left_sidebar() {
    	genesis_widget_area( 'lgd-psl-widget', array(
    		'before' => '<div class="lgd-psl-widget left-sidebar widget-area">',
            'after' => '</div>',
    	) );
    }

    :)

    Best,
    Lauren


    I do custom WordPress work! http://oncecoupled.com
    Contact me directly: lauren@oncecoupled.com

    #102967

    GK
    Member
    Post count: 8

    Thank You Lauren & please excuse my ignorance but should it be more like:

    //* Hook new widget area
    add_action( 'genesis_after_header', 'ambiance_entry_background' );
    function new_widget() {
    
    	if ( is_singular( 'post' ) || ( is_singular( 'page' ) && has_post_thumbnail() ) ) {
    
    		echo '<div class="new-widget"></div>';
    	}
    
    }

    In my functions file?

    ?

    • This reply was modified 4 months, 3 weeks ago by  GK.
    • This reply was modified 4 months, 3 weeks ago by  GK.
Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.