/** * Register custom widget areas. * * @since 1.0.0 */ function trestle_register_widget_areas() { genesis_register_widget_area(array('id' => 'sample-widget-area', 'name' => __('Sample Widget Area', 'trestle'), 'description' => __('This is the sample widget area', 'trestle'))); }
<?php /** * * WooCommerce specific functions * @since 1.0 * */ /** * Register WooCommerce Sidebar(s) * The theme features different sidebars for WooCommerce pages * @since 1.0 */ genesis_register_widget_area(array('name' => 'WooCommerce Primary SB', 'id' => 'cuttz-woo-primary-sb', 'description' => 'This is the primary sidebar for WooCommerce pages.')); genesis_register_widget_area(array('name' => 'WooCommerce Secondary SB', 'id' => 'cuttz-woo-secondary-sb', 'description' => 'This is the secondary sidebar for WooCommerce pages.')); /** * Display WooCommerce Sidebar(s) on WooCommerce pages * @since 1.0 */ add_action('genesis_before', 'cuttz_woo_sidebars'); function cuttz_woo_sidebars() { $use_woo_sb = apply_filters('cuttz_use_woo_sidebars', true); if (!$use_woo_sb) { return; } if (is_woocommerce() || is_cart() || is_checkout()) { remove_action('genesis_sidebar', 'genesis_do_sidebar'); remove_action('genesis_sidebar_alt', 'genesis_do_sidebar_alt'); add_action('genesis_sidebar', 'cuttz_woo_do_sidebar'); add_action('genesis_sidebar_alt', 'cuttz_woo_do_sidebar_alt');
/** * Register after-entry widget area if user specifies in the child theme. * * @since 2.1.0 * * @return null Return early if there is no theme support for `genesis-after-entry-widget-area`. */ function genesis_register_after_entry_widget_area() { if (!current_theme_supports('genesis-after-entry-widget-area')) { return; } genesis_register_widget_area(array('id' => 'after-entry', 'name' => __('After Entry', 'genesis'), 'description' => __('Widgets in this widget area will display after single entries.', 'genesis'), '_builtin' => true)); }
/** * Registers all the custom widget areas * @return none * @since 1.0 */ function cuttz_register_sidebars() { genesis_register_widget_area(array('name' => __('Before Header', 'cuttz-framework'), 'id' => 'before-header', 'description' => __('These widgets will show up above the header.', 'cuttz-framework'))); genesis_register_widget_area(array('name' => __('After Header', 'cuttz-framework'), 'id' => 'after-header', 'description' => __('These widgets will show up below the header.', 'cuttz-framework'))); genesis_register_widget_area(array('name' => __('Above Footer', 'cuttz-framework'), 'id' => 'above-footer', 'description' => __('These widgets will show up above the footer or the footer widgets if they are enabled.', 'cuttz-framework'))); }
//* Enqueue jQuery core files from header to footer in WordPress function rw_enqueue_jquery_in_footer(&$scripts) { if (!is_admin()) { $scripts->registered['jquery']->args = 1; $scripts->registered['jquery-core']->args = 1; $scripts->registered['jquery-migrate']->args = 1; } } add_action('wp_default_scripts', 'rw_enqueue_jquery_in_footer', 11); function rw_add_enqueue_jquery_in_footer() { wp_enqueue_script('jquery-core'); wp_enqueue_script('jquery-migrate'); } add_action('init', 'rw_add_enqueue_jquery_in_footer'); //* Enqueue EQCSS // http://elementqueries.com/ add_action('wp_enqueue_scripts', 'sk_enqueue_scripts'); function sk_enqueue_scripts() { wp_enqueue_script('EQCSS', get_stylesheet_directory_uri() . '/js/EQCSS.min.js', '', '', true); } // Register bottom-flyout widget area genesis_register_widget_area(array('id' => 'bottom-flyout', 'name' => __('Bottom Flyout', 'my-theme-text-domain'), 'description' => __('Widget(s) placed here will appear on scrolling down from bottom right', 'my-theme-text-domain'))); // Display bottom-flyout widget area add_action('wp_footer', 'sk_bottom_flyout'); function sk_bottom_flyout() { genesis_widget_area('bottom-flyout', array('before' => '<div class="bottom-flyout">', 'after' => '</div>')); }
function news_secondheader() { genesis_register_widget_area(array('id' => 'after-nav-primary', 'name' => __('Credits Left', 'jan'), 'description' => __('This is the footer Credits Left area.', 'jan'))); }