Current Path : /var/test/www/ya/wp-content/themes/youthy/framework/ |
Current File : /var/test/www/ya/wp-content/themes/youthy/framework/widgets.php |
<?php /* ####################################################################### Register Sidebars for Widgets ####################################################################### */ function meanthemes_register_sidebars() { if ( function_exists('register_sidebar') ) register_sidebar(array( 'id' => 'footer-widgets', 'name' => __( 'Footer Widget Area', 'meanthemes' ), 'description' => __( 'This appears on the footer below all content right at the bottom of the page.', 'meanthemes' ), 'before_widget' => '<div class="widget footer">', 'after_widget' => '</div>', 'before_title' => '<h4>', 'after_title' => '</h4>', )); register_sidebar(array( 'id' => 'homepage-widgets', 'name' => __( 'Homepage Widget Area', 'meanthemes' ), 'description' => __( 'This allows you to control your fully widgetized homepage. Please only use the widgets with "MT Homepage: " in the name.', 'meanthemes' ), 'before_widget' => '<section class="home-widget %2$s" id="%1$s"><div class="loop">', 'after_widget' => '</div></section>', 'before_title' => '<h2>', 'after_title' => '</h2>', )); register_sidebar(array( 'id' => 'sidebar-widgets', 'name' => __( 'Sidebar Widget Area', 'meanthemes' ), 'description' => __( 'This appears on the posts only, please make sure you have ticked sidebar on in Appearance > Customize > Sidebar Settings.', 'meanthemes' ), 'before_widget' => '<div class="widget sidebar sidebar-post">', 'after_widget' => '</div>', 'before_title' => '<h4>', 'after_title' => '</h4>', )); register_sidebar(array( 'id' => 'sidebar-page-widgets', 'name' => __( 'Sidebar Page Widget Area', 'meanthemes' ), 'description' => __( 'This appears on the pages only, please make sure you have ticked sidebar on in Appearance > Customize > Sidebar Settings.', 'meanthemes' ), 'before_widget' => '<div class="widget sidebar sidebar-page">', 'after_widget' => '</div>', 'before_title' => '<h4>', 'after_title' => '</h4>', )); register_sidebar(array( 'id' => 'team-widgets', 'name' => __( 'Team Widget Area', 'meanthemes' ), 'description' => __( 'This shows on just the team related pages.', 'meanthemes' ), 'before_widget' => '<div class="widget sidebar sidebar-team">', 'after_widget' => '</div>', 'before_title' => '<h4>', 'after_title' => '</h4>', )); register_sidebar(array( 'id' => 'service-widgets', 'name' => __( 'Services Widget Area', 'meanthemes' ), 'description' => __( 'This shows on just the service related pages.', 'meanthemes' ), 'before_widget' => '<div class="widget sidebar sidebar-service">', 'after_widget' => '</div>', 'before_title' => '<h4>', 'after_title' => '</h4>', )); register_sidebar(array( 'id' => 'social-header-widgets', 'name' => __( 'Social Header Widget Area', 'meanthemes' ), 'description' => __( 'This appears in the top nav area and is only for the MeanThemes Social Widget.', 'meanthemes' ), 'before_widget' => '', 'after_widget' => '', 'before_title' => '', 'after_title' => '', )); register_sidebar(array( 'id' => 'social-widgets', 'name' => __( 'Social Footer Widget Area', 'meanthemes' ), 'description' => __( 'This appears in the footer area and is only for the MeanThemes Social Widget.', 'meanthemes' ), 'before_widget' => '', 'after_widget' => '', 'before_title' => '', 'after_title' => '', )); register_sidebar(array( 'id' => 'pnf-widgets', 'name' => __( '404 Page Widget Area', 'meanthemes' ), 'description' => __( 'This allows you to control your fully widgetized 404 Page. Please only use the widgets with "MT Homepage: " in the name.', 'meanthemes' ), 'before_widget' => '<section class="home-widget %2$s" id="%1$s"><div class="loop">', 'after_widget' => '</div></section>', 'before_title' => '<h2>', 'after_title' => '</h2>', )); if ( class_exists( 'WooCommerce' ) ) { register_sidebar(array( 'id' => 'woocommerce-widgets', 'name' => __( 'WooCommerce Widget Area', 'meanthemes' ), 'description' => __( 'This appears on the woocommerce individual product pages only, please make sure you have ticked sidebar on in Theme Customizer > WooCommerce Settings.', 'meanthemes' ), 'before_widget' => '<div class="widget sidebar sidebar-post">', 'after_widget' => '</div>', 'before_title' => '<h4>', 'after_title' => '</h4>', )); } /** * If a WP Instagram Widget is active */ if ( ! function_exists( 'is_plugin_active' ) ) { require_once( ABSPATH . '/wp-admin/includes/plugin.php' ); } if ( is_plugin_active( 'wp-instagram-widget/wp-instagram-widget.php' ) ) { register_sidebar(array( 'id' => 'instagram-widget', 'name' => __( 'Instagram Widget Area', 'meanthemes' ), 'description' => __( 'This appears right at the bottom of the page and only shows if the WP Instagram widget is active.', 'meanthemes' ), 'before_widget' => '<div class="instagrams">', 'after_widget' => '</div>', 'before_title' => '<div class="instagrams-title">', 'after_title' => '</div>', )); } } add_action( 'widgets_init', 'meanthemes_register_sidebars' ); // Invoke Colour Picker $basedir = get_template_directory() . '/framework/'; function load_colorpicker_admin() { wp_enqueue_script( 'wp-color-picker' ); wp_enqueue_style( 'wp-color-picker' ); wp_enqueue_script('meanthemes-widget-color', get_template_directory_uri() . '/framework/js/widget-color.js',array('jquery'), '1.0.0', true); } add_action( 'admin_enqueue_scripts', 'load_colorpicker_admin' ); // Include Theme specific widgets require_once( $basedir . 'widgets/widget-slider.php' ); require_once( $basedir . 'widgets/widget-logos.php' ); require_once( $basedir . 'widgets/widget-testimonials.php' ); require_once( $basedir . 'widgets/widget-services.php' ); require_once( $basedir . 'widgets/widget-blog.php' ); require_once( $basedir . 'widgets/widget-team.php' ); require_once( $basedir . 'widgets/widget-event.php' ); ?>