Decor Theme and Genesis Responsive Slider

Community Forums Forums Design Tips and Tricks Decor Theme and Genesis Responsive Slider

This topic is: resolved

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

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

    PresterJohn
    Participant
    Post count: 56

    The Subject pretty much says it all. Help.

    How do I put Genesis Responsive Slider in the Decor Theme (you’d think they’d widgetize these things!).

    Above the entire body (full width) or just next to the sidebar and above the recent posts – either is fine.

    I’d go with a new theme, but this one has too many elements which my client likes.

    http://palate2palette.com
    #79659

    nutsandbolts
    Moderator
    Post count: 2603

    Decor doesn’t have a home.php? If not, you could create one and include a widget area for the slider. I’m not at my computer but let me know if you need help and I’ll be glad to walk you through.


    Andrea Whitmer, Owner, Nuts and Bolts Media
    I do Genesis tutorials, design and development, and other fun stuff • Find me on Twitter and Google+

    #79661

    PresterJohn
    Participant
    Post count: 56

    nutsandbolts – I need help. Thanks.

    #79666

    nutsandbolts
    Moderator
    Post count: 2603

    Okay, I have to run out to the grocery store but will come back in a bit with a solution for you. I just want to test it first to be sure it will look okay.


    Andrea Whitmer, Owner, Nuts and Bolts Media
    I do Genesis tutorials, design and development, and other fun stuff • Find me on Twitter and Google+

    #79680

    nutsandbolts
    Moderator
    Post count: 2603

    All right, this is going to involve editing two theme files and adding a new one, but I promise it’s not too bad. Just be sure you have FTP or CPanel access to the site handy in case something goes wrong – when you edit functions, if you leave out a comma or semicolon, it can bring your site down. (That said, anything that gets broken can be fixed, so no worries.)

    VERY important – be sure to copy these from the forum page and not from the email notification. The email strips out some of the formatting and will definitely break the site.

    First, we’re going to edit functions.php:

    At the very bottom of the file, leave a blank line after the final function and paste this in:

    /** Register widget areas */
    genesis_register_sidebar( array(
    	'id'			=>	'slider',
    	'name'			=>	__( 'Slider', 'decor' ),
    	'description'	=>	__( 'This is the slider section.', 'decor' ),
    ) );

    Then create a new file in the Decor folder called home.php:

    Edit the file and paste in all of the following:

    <?php
    
    //* Add widget support for homepage. If no widgets active, display the default loop.
    
    add_action( 'genesis_meta', 'decor_home_genesis_meta' );
    function decor_home_genesis_meta() {
    	global $paged;
    	if( $paged < 1 ) {
    		if ( is_active_sidebar( 'slider' ) ) {
    			add_action( 'genesis_before_loop', 'decor_home_loop_helper', 1 );
    		}
    	}	
    }
    
    function decor_home_loop_helper() {
    		
    		echo '<div id="slider">';
    		
    		genesis_widget_area( 'slider', array( 
    			'before'	=>	'<div class="slider widget-area">' 
    		) );
    
    		echo '</div>';	
    }
    
    genesis();

    Finally, add this to your stylesheet:

    /* Slider
    ------------------------------------------------------------ */
    
    #slider {
    	padding-bottom: 7px;
    	margin: 0 0 20px;
    }

    You may need to tweak the CSS a little to make it work with your existing styles, but overall it turned out pretty nice on my test site. I used the Genesis Responsive Slider plugin, but since Decor isn’t responsive, you could use the regular Genesis Slider plugin instead. It actually seems to be easier to deal with in my experience.

    Let me know how it goes!


    Andrea Whitmer, Owner, Nuts and Bolts Media
    I do Genesis tutorials, design and development, and other fun stuff • Find me on Twitter and Google+

    #79684

    PresterJohn
    Participant
    Post count: 56

    Ok. Here goes.

    #79685

    PresterJohn
    Participant
    Post count: 56

    How do I create the home.php file? in FTP?

    Sorry but I’ve not done it before.

    • This reply was modified 4 months ago by  PresterJohn.
    • This reply was modified 4 months ago by  PresterJohn.
    #79687

    nutsandbolts
    Moderator
    Post count: 2603

    What FTP program are you using and who is your host? The method is different depending on what you’re using and who you host with.


    Andrea Whitmer, Owner, Nuts and Bolts Media
    I do Genesis tutorials, design and development, and other fun stuff • Find me on Twitter and Google+

    #79688

    nutsandbolts
    Moderator
    Post count: 2603

    What FTP program are you using and who is your host? The method is different depending on what you’re using and who you host with.


    Andrea Whitmer, Owner, Nuts and Bolts Media
    I do Genesis tutorials, design and development, and other fun stuff • Find me on Twitter and Google+

    #79689

    PresterJohn
    Participant
    Post count: 56

    Okay – it’s working. Thank you so much! Whew. I mostly do the design part of things, but my coding guys isn’t available for this.

    And, I believe Decor IS mobile responsive – at least mine is!

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

You must be logged in to reply to this topic.