Changing function of "Genesis – Featured Posts" image

Community Forums Forums Design Tips and Tricks Changing function of "Genesis – Featured Posts" image

This topic is: not resolved

This topic contains 2 replies, has 2 voices, and was last updated by  braddalton 8 months ago.

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

    NWTD
    Participant
    Post count: 61

    Is there a way to change how the image is displayed? Rather than just showing a thumbnail, I’d like to use it for the background of the widget area. I need it as the background to utilize the background-size property to integrate it properly into my theme.

    Ideally this would be done in my theme, not the Genesis Framework.

    Thanks!

    • This topic was modified 8 months ago by  NWTD.
    • This topic was modified 8 months ago by  NWTD.
    • This topic was modified 8 months ago by  NWTD.
    • This topic was modified 8 months ago by  NWTD.
    #92179

    NWTD
    Participant
    Post count: 61

    Rather than altering the way the widget functions, could I add my desired output to the widget callback in the template?

    My current theme is calling the widget with the following:

    genesis_widget_area( 'home-top', array(
    	'before' => '<div class="home-top widget-area"><div class="wrap">',
    	'after'  => '</div></div>',
    ) );

    I tried the following with no luck…maybe there’s a better way?

    $bkgd_img = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'home-top' );
    	
    genesis_widget_area( 'home-top', array(
    	'before' => '<div class="home-top widget-area" style="background-image: url(' . $bkgd_img . ');"><div class="wrap">',
    	'after'  => '</div></div>',
    ) );
    • This reply was modified 8 months ago by  NWTD. Reason: formatting
    • This reply was modified 8 months ago by  NWTD.
    • This reply was modified 8 months ago by  NWTD. Reason: formatting
    • This reply was modified 8 months ago by  NWTD.
    #92214

    braddalton
    Participant
    Post count: 10261

    I don’t think so but its a great question.

    I think you will need to filter the Genesis featured posts plugins output.

    Or maybe this plugin may include that option https://github.com/wpsmith/genesis-sandbox-featured-content-widget


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

You must be logged in to reply to this topic.