Home>Support>Add Widget Area in Home Page Slider

Add Widget Area in Home Page Slider

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

URL: http://wablues.monster-tamer.com/site

This is our free support forum. Replies can take several days. If you need fast email support, please purchase a SiteOrigin Premium license.

  1. 9 years, 11 months ago Jeff Snelling

    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. :-)

    ?><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') ) {dynamic_sidebar( 'slider-sidebar-1' );}?></div><?php
    
  2. 9 years, 11 months ago Andrew Misplon
    Hi, I Work Here

    Hi Jeff

    Super, really glad to hear you made progress here. Thanks for sharing.

    All the best.

Replies on this thread are closed. Please create a new thread if you have a question, or purchase a SiteOrigin Premium license if you need one-on-one email support.

Get The Most Out of SiteOrigin with SiteOrigin Premium

Find Out More