Adding A Nivo Slider to Expose Child Theme

Community Forums Forums Design Tips and Tricks Adding A Nivo Slider to Expose Child Theme

This topic is: not resolved

This topic contains 10 replies, has 4 voices, and was last updated by  braddalton 1 year, 5 months ago.

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #12201

    e96989955
    Participant
    Post count: 15

    I’m currently using a Nivo Slider for WordPress plugin to add a Nivo Slider to my theme. I would like to have it appear between my top navigation menu and the grid posts. However, I seem to have trouble figuring out how to add the piece of code provided by the plugin.

    <?php if (function_exists(‘nivoslider4wp_show’)) { nivoslider4wp_show(); } ?>

     

    I’ve tried adding it to home.php and custom-header.php but it always appears misaligned to the left on the top of the page.

    Help? :(

    #12207

    buddy_boy8403
    Participant
    Post count: 132

    If I were you, I would add a widget area with a conditional to only show on the home page and try using the genesis_after_header. Then drag the slider to the widget area, or use a php widget and add in the embed code there if necessary.

    To add the widget area, copy the below into your child theme’s functions.php file:

    genesis_register_sidebar( array(
    'id' => 'nivio-slider-home ',
    'name' => 'Nivio Slider',
    'description' => 'This is a sidebar for the Nivio Slider that goes on the home page after the header.',
    ) );
    add_action( 'genesis_after_header', 'child_genesis_after_header_nivio_sidebar' );
    /** Loads a new sidebar after the header*/
    function child_genesis_after_header_nivio_sidebar() {
    if (is_home() ) {
    echo '';
    dynamic_sidebar( 'nivio-slider-sidebar' );
    echo '';
    }
    }

    And then style the sidebar however you want it in your child theme’s style.css file. Below is an example:

    /* Nivio Slider Sidebar
    ------------------------------------------------------------ */
    .nivio-slider-sidebar{
    clear: both;
    margin: 0 auto;
    width: 728px;
    }

    #12229

    e96989955
    Participant
    Post count: 15

    I’ve added the code as you suggested and used a php widget to embed the code provided by the Nivo Slider Plugin, but nothing appears. :(

    http://www.thenewlaunchguru.com

    #12230

    buddy_boy8403
    Participant
    Post count: 132

    Are you sure you used a php widget and not the text widget?

    #12236

    buddy_boy8403
    Participant
    Post count: 132

    One other thing – if you are not absoultely set on the Nivo slider, you could always use the Genesis Slider, which is developed by studiopress and supported here in the forums.  It’s widgetized so you can just configure the slider in the settings page and then go to your widgets page and drag the entire slider in the sidebar you already created for Nivo.  Then you can avoid having to add in embed code in the php widget.  This is a cleaner (and safer) route to go.

    #12246

    e96989955
    Participant
    Post count: 15

    Yup, I used a PHP widget called Linkable Title Html and Php Widget by PepLamb. 

    I’ll give the Genesis Slider a try!

    #12247

    buddy_boy8403
    Participant
    Post count: 132

    I’m seeing the image slider.  Did you get your problem fixed?

    #12250

    e96989955
    Participant
    Post count: 15

    Yup! I actually added the php embed code directly to the Genesis framework header.php file and it worked. :)

    #12523

    buddy_boy8403
    Participant
    Post count: 132

    Yup! I actually added the php embed code directly to the Genesis framework header.php file and it worked.

    You shouldn’t edit the genesis code directly.  Your mods will be overwritten when studiopress releases genesis updates.

    #17706

    SunnyDog
    Participant
    Post count: 1

    I added this code in the child functions.php section because I too was trying to add a slider widget area. I didn’t work, so I removed it, but right after that I could not access my site at all. I had tried some other code prior to that, which broke the site but that resolved when I removed the added code and refreshed, just like I did with your suggested code. But this time, site access went down.  Any ideas on what your code might have caused and how I can get my site back up?

    #17730

    braddalton
    Participant
    Post count: 8875

    You can easily add easing slider using the Genesis Simple Hooks plugin.


    Specializing In StudioPress Child Theme Customization.
    500+ StudioPress Tutorials

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

You must be logged in to reply to this topic.