Your account expired support, please renew to get your support.

Home Forums Themes Support Claue Is it possible to create a new widget?

Viewing 1 reply thread
  • Author
    Posts
    • #38075
      Lqq
      Support Expired

      Hi there,

      is it possible to create a new widget?

      Thanks.

    • #38080
      Harry
      Support Expired

      Hi,

      You mean widget area?

      Please add below code to claue-child > functions.php

      if ( ! function_exists( 'jas_claue_child_register_sidebars' ) ) {
      	function jas_claue_register_sidebars() {
      		register_sidebar(
      			array(
      				'name'          => esc_html__( 'New Sidebar', 'claue' ),
      				'id'            => 'new-sidebar',
      				'description'   => esc_html__( 'The New Sidebar', 'claue' ),
      				'before_widget' => '<aside id="%1$s" class="widget %2$s">',
      				'after_widget'  => '</aside>',
      				'before_title'  => '<h4 class="widget-title fwm">',
      				'after_title'   => '</h4>',
      			)
      		);
      	}
      }
      add_action( 'widgets_init', 'jas_claue_child_register_sidebars' );

      and add below code to the position you want show widget

      <?php if ( is_active_sidebar( 'new-sidebar' ) ) : ?>
      		<div class="new-sidebar">
      			<?php if ( ! function_exists( 'dynamic_sidebar' ) || ! dynamic_sidebar( 'new-sidebar' ) ) : endif; ?>
      		</div>
      <?php endif; ?>

      Kind regards

      Harry
      Premium Wordpress themes and plugins, Best WooCommerce theme https://themeforest.net/user/janstudio/portfolio?ref=janstudio

Viewing 1 reply thread

You must be logged in to reply to this topic.