Community Forums › Forums › Archived Forums › Design Tips and Tricks › Adding A Nivo Slider to Expose Child Theme
- This topic has 10 replies, 4 voices, and was last updated 12 years, 2 months ago by
Brad Dalton.
-
AuthorPosts
-
January 15, 2013 at 10:08 pm #12201
e96989955
MemberI'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? 🙁
January 15, 2013 at 10:33 pm #12207buddy_boy8403
ParticipantIf 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;
}January 16, 2013 at 12:14 am #12229e96989955
MemberI'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. 🙁
January 16, 2013 at 12:16 am #12230buddy_boy8403
ParticipantAre you sure you used a php widget and not the text widget?
January 16, 2013 at 12:29 am #12236buddy_boy8403
ParticipantOne 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.
January 16, 2013 at 1:26 am #12246e96989955
MemberYup, I used a PHP widget called Linkable Title Html and Php Widget by PepLamb.
I'll give the Genesis Slider a try!
January 16, 2013 at 1:27 am #12247buddy_boy8403
ParticipantI'm seeing the image slider. Did you get your problem fixed?
January 16, 2013 at 1:53 am #12250e96989955
MemberYup! I actually added the php embed code directly to the Genesis framework header.php file and it worked. 🙂
January 16, 2013 at 8:20 pm #12523buddy_boy8403
ParticipantYup! 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.
February 3, 2013 at 6:30 pm #17706SunnyDog
MemberI 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?
February 3, 2013 at 8:02 pm #17730Brad Dalton
ParticipantYou can easily add easing slider using the Genesis Simple Hooks plugin.
-
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.