This thread is over two years old and may be outdated. Please create a new thread if you need help, or email us if you have an active Premium license.

Add Widget Area in Home Page Slider

Resolved 2 replies premiumthemetheme-vantage
11 years ago · Last reply by Andrew Misplon 11 years ago

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.

Need fast email support? Get SiteOrigin Premium

Replies

2
  1. Jeff Snelling 11 years, 4 months ago

    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. Andrew Misplon Staff 11 years, 4 months ago

    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.

Have a different question or issue?

Start New Thread