• Megan

    (@singinglawlady)


    Is there a way to make an image autoupdate in a container by using code in the functions php file? This is probably a dumb question and I’m probably not asking it right.

    Basically, I want a box above my posts on all pages like this. So far, I have gotten the box to show up, but I would have to manually update the functions file everytime I post something within that cateogory that box would be linked to.
    I don’t want this person’s theme, I only want that one element.
    Here is a link to what I’m looking for:
    https://i1282.photobucket.com/albums/a537/singinglawlady/ScreenCaptureatWedJul31193928CDT2013.png

    Here is my code:

    genesis_register_sidebar( array(
            'id'            => 'a_widget',
            'name'          => __( 'Homepage Below Menu' ),
            'description'   => __( 'This is below the bottom menu of the homepage.' ),
    ) );
    
    	add_action( 'genesis_before_content', 'widget_before_content' );
    	function widget_before_content() {
     	   echo '<div id="a_widget">';
    	dynamic_sidebar( 'a_widget' );
    		echo '<a href="/category/reviews/"><div class="promo_sect"><div class="promo_sect_img" style="background-image: url(INSERT LINK TO IMAGE HERE);"></div>CAPTION</div></a>';
    		echo '<a href="/category/cover-reaveals/"><div class="promo_sect"><div class="promo_sect_img" style="background-image: url(INSERT LINK TO IMAGE HERE);"></div>CAPTION</div></a>';
    	    echo '<div class="promo_sect"></div>';
    	    echo '<div class="promo_sect"></div>';
        	echo '<div class="promo_sect"></div>';
        	echo '</div>';
    
    }

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Auto-update image in functions php file’ is closed to new replies.