Notice: These forums are now retired and closed. For active support, please Submit a Ticket or visit our official WordPress.org community pages.
Kadence Theme | Kadence Blocks | Starter Templates | WooCommerce Email Designer | Ascend | Virtue | Pinnacle

new widget area

Home / Forums / Virtue Theme / new widget area

This topic is: Resolved
[Resolved]
Posted in: Virtue Theme
January 5, 2015 at 2:39 am

Hello! I would like to add a new widget area (dynamic sidebar) into Virtue Premium Theme. I need a widget at the bottom of the post for placing an advertising banner.

Example of an advertising banner at the bottom of the post

Example of an advertising banner on screenshot

My website

I’m going to modify child theme according to the instructions
Where exactly can I implement the code?

I mean the following code:
for functions.php

function tq_widgets_init() {
register_sidebar( array(
'name' => 'Content bottom',
'id' => 'content-bottom-1',
'description' => 'Area under the content',
'before_widget' => '<div>',
'after_widget' => '</div>',
'before_title' => '<h3 class="widget-content-bottom">',
'after_title' => '</h3>',
) );
}
add_action( 'widgets_init', 'tq_widgets_init' );

for sidebar.php

<?php if ( is_active_sidebar( 'content-bottom-1' ) ) : ?>
<div class="content-bottom-1" role="complementary">
<?php dynamic_sidebar( 'content-bottom-1' ); ?>
</div>
<?php endif; // end content-bottom widget area ?>

for content-single.php

<?php get_sidebar('content-bottom-1'); ?>

  • The forum ‘Virtue Theme’ is closed to new topics and replies.