Hello, I’m using the premium version of Vantage and the Meta-Slider as my choice for the home page slider. I need to add a widget within the right edge of the slider div (main-slider div) so I can display a calendar widget.
I will be adding a child theme at some point, but right now just testing to see if this can be done, so I’m modifying the Vantage theme directly. I have registered a new widget in Functions.php
register_sidebar( array( 'name' => __( 'Slider', 'vantage' ), 'id' => 'slider-sidebar-1', 'before_widget' => '<aside id="%1$s" class="widget %2$s">', 'after_widget' => '</aside>', 'before_title' => '<h3 class="widget-title">', 'after_title' => '</h3>', ) );
And then further down in the functions.php code, I found the render code for the slider, so I added the line below where the div id=”main-slier”:
?><div id="main-slider" <?php if( siteorigin_setting('home_slider_stretch') ) echo 'data-stretch="true"' ?>><?php ?><div id="sliderWidget"><?php if( is_active_sidebar('slider-sidebar-1') );?></div><?php
I added a text widget to the new widget area, but it’s not showing up. I’m wondering if I’m even adding this to the right place. Seems odd to have HTML code in the functions.php, but that’s the only place I see the “main-slider” div.
Cheers,
Jeff
Sorry Gang, my bad… I forgot to call the sidebar code, which would look like this. Seems to work and the widget is now showing. :-)
Hi Jeff
Super, really glad to hear you made progress here. Thanks for sharing.
All the best.