Example #1
0
 function penscratch_has_footer_widgets()
 {
     if (has_nav_menu('social') || jetpack_is_mobile('', true) && is_active_sidebar('sidebar-1')) {
         return true;
     }
     return false;
 }
Example #2
0
/**
 * Count the number of footer sidebars to enable dynamic classes for the footer
 */
function twentyeleven_footer_sidebar_class()
{
    $count = 0;
    if (is_active_sidebar('sidebar-3')) {
        $count++;
    }
    if (is_active_sidebar('sidebar-4')) {
        $count++;
    }
    if (is_active_sidebar('sidebar-5')) {
        $count++;
    }
    $class = '';
    switch ($count) {
        case '1':
            $class = 'one';
            break;
        case '2':
            $class = 'two';
            break;
        case '3':
            $class = 'three';
            break;
    }
    if ($class) {
        echo 'class="' . $class . '"';
    }
}
Example #3
0
/**
 * Adds custom classes to the array of body classes.
 *
 * @param array $classes Classes for the body element.
 * @return array
 */
function siteorigin_north_body_classes($classes)
{
    // Adds a class of group-blog to blogs with more than 1 published author.
    if (is_multi_author()) {
        $classes[] = 'group-blog';
    }
    $classes[] = 'no-js';
    $classes[] = 'css3-animations';
    $classes[] = 'responsive';
    if (is_page()) {
        $classes[] = 'page-layout-' . SiteOrigin_Settings_Page_Settings::get('layout');
        $classes[] = 'page-layout-menu-' . SiteOrigin_Settings_Page_Settings::get('menu');
        if (!SiteOrigin_Settings_Page_Settings::get('masthead_margin')) {
            $classes[] = 'page-layout-no-masthead-margin';
        }
        if (!SiteOrigin_Settings_Page_Settings::get('footer_margin')) {
            $classes[] = 'page-layout-no-footer-margin';
        }
    }
    if (!is_active_sidebar('main-sidebar')) {
        $classes[] = 'no-active-sidebar';
    }
    if (siteorigin_setting('navigation_sticky')) {
        $classes[] = 'sticky-menu';
    }
    if (wp_is_mobile()) {
        $classes[] = 'is_mobile';
    }
    return $classes;
}
Example #4
0
/**
 * Add widget support for homepage. If no widgets active, display the default loop.
 *
 */
function parallax_home_genesis_meta()
{
    if (is_active_sidebar('home-section-1') || is_active_sidebar('home-section-2') || is_active_sidebar('home-section-3') || is_active_sidebar('home-section-4') || is_active_sidebar('home-section-5')) {
        //* Enqueue parallax script
        add_action('wp_enqueue_scripts', 'parallax_enqueue_parallax_script');
        function parallax_enqueue_parallax_script()
        {
            if (!wp_is_mobile()) {
                wp_enqueue_script('parallax-script', get_bloginfo('stylesheet_directory') . '/js/parallax.js', array('jquery'), '1.0.0');
            }
        }
        //* Add parallax-home body class
        add_filter('body_class', 'parallax_body_class');
        function parallax_body_class($classes)
        {
            $classes[] = 'parallax-home';
            return $classes;
        }
        //* Force full width content layout
        add_filter('genesis_pre_get_option_site_layout', '__genesis_return_full_width_content');
        //* Remove primary navigation
        remove_action('genesis_before_content_sidebar_wrap', 'genesis_do_nav');
        //* Remove breadcrumbs
        remove_action('genesis_before_loop', 'genesis_do_breadcrumbs');
        //* Remove the default Genesis loop
        remove_action('genesis_loop', 'genesis_do_loop');
        //* Add homepage widgets
        add_action('genesis_loop', 'parallax_homepage_widgets');
    }
}
Example #5
0
/**
 * Adds custom classes to the array of body classes.
 *
 * @param array $classes Classes for the body element.
 * @return array
 */
function ultra_body_classes($classes)
{
    // Adds a class of group-blog to blogs with more than 1 published author.
    if (is_multi_author()) {
        $classes[] = 'group-blog';
    }
    // Adds a class of content-none if there are no posts.
    if (!have_posts()) {
        $classes[] = 'content-none';
    }
    // Add widget-dependent classes.
    if (!is_active_sidebar('sidebar-1')) {
        $classes[] = 'one-column';
    }
    // Add a class if the sidebar is use.
    if (is_active_sidebar('sidebar-1')) {
        $classes[] = 'sidebar';
    }
    // Add a class if viewed on mobile.
    if (wp_is_mobile()) {
        $classes[] = 'mobile-device';
    }
    if (siteorigin_setting('header_tagline')) {
        $classes[] = 'tagline';
    }
    // Add a class if the page slider overlap is true.
    if (get_post_meta(get_the_ID(), 'ultra_metaslider_slider_overlap', true) == true) {
        $classes[] = 'overlap';
    }
    return $classes;
}
Example #6
0
 function get_bootplate_widget_footer_cols()
 {
     $got1 = is_active_sidebar('footer-1');
     $got2 = is_active_sidebar('footer-2');
     $got3 = is_active_sidebar('footer-3');
     $got4 = is_active_sidebar('footer-4');
     if ($got1 || $got2 || $got3 || $got4) {
         $gotsome = true;
     } else {
         $gotsome = false;
     }
     if ($got1 && $got2 && $got3 && $got4) {
         $gotall = true;
     } else {
         $gotall = false;
     }
     if ($gotall) {
         $classes = 'col-sm-6 col-lg-3';
     } elseif ($got1 && $got2 && !$got3 && !$got4 || !$got1 && !$got2 && $got3 && $got4) {
         $classes = 'col-sm-6';
     } elseif ($got1 && $got2 && $got3 && !$got4) {
         $classes = 'col-sm-4';
     } elseif ($got1 && $got2 && $got3 && $got4) {
         $classes = 'col-sm-6 col-lg-3';
     } else {
         $classes = 'col-md-12';
     }
     if ($gotsome) {
         return $classes;
     } else {
         return '';
     }
 }
Example #7
0
/**
 * Echo the markup necessary to facilitate the footer widget areas.
 *
 * Check for a numerical parameter given when adding theme support - if none is found, then the function returns early.
 *
 * The child theme must style the widget areas.
 *
 * Applies the `genesis_footer_widget_areas` filter.
 *
 * @since 1.6.0
 *
 * @uses genesis_structural_wrap() Optionally adds wrap with footer-widgets context.
 *
 * @return null Return early if number of widget areas could not be determined, or nothing is added to the first widget area.
 */
function genesis_footer_widget_areas()
{
    $footer_widgets = get_theme_support('genesis-footer-widgets');
    if (!$footer_widgets || !isset($footer_widgets[0]) || !is_numeric($footer_widgets[0])) {
        return;
    }
    $footer_widgets = (int) $footer_widgets[0];
    //* Check to see if first widget area has widgets. If not, do nothing. No need to check all footer widget areas.
    if (!is_active_sidebar('footer-1')) {
        return;
    }
    $inside = '';
    $output = '';
    $counter = 1;
    while ($counter <= $footer_widgets) {
        //* Darn you, WordPress! Gotta output buffer.
        ob_start();
        dynamic_sidebar('footer-' . $counter);
        $widgets = ob_get_clean();
        if ($widgets) {
            $inside .= sprintf('<div class="footer-widgets-%d widget-area">%s</div>', $counter, $widgets);
        }
        $counter++;
    }
    if ($inside) {
        $output .= genesis_markup(array('html5' => '<div %s>' . genesis_sidebar_title('Footer'), 'xhtml' => '<div id="footer-widgets" class="footer-widgets">', 'context' => 'footer-widgets', 'echo' => false));
        $output .= genesis_structural_wrap('footer-widgets', 'open', 0);
        $output .= $inside;
        $output .= genesis_structural_wrap('footer-widgets', 'close', 0);
        $output .= '</div>';
    }
    echo apply_filters('genesis_footer_widget_areas', $output, $footer_widgets);
}
Example #8
0
function emphasize_bottomgroup()
{
    $count = 0;
    if (is_active_sidebar('bottom1')) {
        $count++;
    }
    if (is_active_sidebar('bottom2')) {
        $count++;
    }
    if (is_active_sidebar('bottom3')) {
        $count++;
    }
    if (is_active_sidebar('bottom4')) {
        $count++;
    }
    $class = '';
    switch ($count) {
        case '1':
            $class = 'col-md-12';
            break;
        case '2':
            $class = 'col-md-6';
            break;
        case '3':
            $class = 'col-md-4';
            break;
        case '4':
            $class = 'col-md-3';
            break;
    }
    if ($class) {
        echo 'class="' . $class . '"';
    }
}
Example #9
0
function custom_body_classes($classes)
{
    if (is_active_sidebar('sidebar-3')) {
        $classes[] = 'footer-widgets';
    }
    return $classes;
}
Example #10
0
    public function __construct()
    {
        if (!is_admin()) {
            return;
        }
        $menus = get_theme_mod('nav_menu_locations');
        $this->theme = wp_get_theme();
        $has_listings = new WP_Query(array('post_type' => 'job_listing', 'fields' => 'ids', 'posts_per_page' => 1));
        $this->steps = array('install-plugins' => array('title' => __('Install Required &amp; Recommended Plugins', 'listify'), 'completed' => class_exists('WP_Job_Manager') && class_exists('WooCommerce'), 'description' => '<p>
						Before you can use Listify you must first install WP Job Manager and WooCommerce. 
						You can read about <a
						href="http://listify.astoundify.com/article/260-why-does-this-theme-require-plugins">why this theme
						requires plugins</a> in our documentation. 
					</p> 
					<p><strong>Note:</strong></strong>
					<ul>
						<li>When installing WP Job Manager and WooCommerce <strong>do not</strong> use the automatic setup and
						install the recommend pages. This will be done automatically when you import the demo XML.</li>
						<li>Only free plugins/add-ons can be installed automatically. You will need to install any premium
						plugins/add-ons separately.</li>
						<li>It is recommended you install and activate any additional plugins you plan on using before importing
						any XML content.</li>
						<li><strong>Once your plugins are installed</strong> and content is imported please review all plugin
						settings pages to make sure everything has been properly set up.</li>
					</ul>' . sprintf('<a href="%1$s/images/setup/setup-plugins.gif"><img
					src="%1$s/images/setup/setup-plugins.gif" width="430" alt=""
					/></a>', get_template_directory_uri()) . '<p>' . sprintf('<a href="%s" class="button button-primary button-large">%s</a>', admin_url('themes.php?page=tgmpa-install-plugins'), __('Install Plugins', 'listify')) . '</p>', 'documentation' => array('WP Job Manager' => 'http://listify.astoundify.com/article/228-wp-job-manager', 'WooCommerce' => 'http://listify.astoundify.com/article/229-woocommerce', 'Jetpack' => 'http://listify.astoundify.com/article/230-jetpack', 'Bulk Install' => 'http://listify.astoundify.com/article/320-bulk-install-required-and-recommended-plugins')), 'import-content' => array('title' => __('Import Demo Content', 'listify'), 'completed' => $has_listings->have_posts(), 'description' => '<p>' . __('Installing the demo content is not required to use this theme. It is simply meant to provide a way to get a feel for the theme without having to manually set up all of your own content. <strong>If you choose not to import the demo content you need to make sure you manually create all necessary page templates for your website.</strong>', 'listify') . '</p>' . '<p>' . __('The Listify theme package includes multiple demo content .XML files. This is what you will
					upload to the WordPress importer. Depending on the plugins you have activated or the intended use of your
					website you may not need to upload all .XML files.', 'listify') . '</p>' . sprintf('<a href="%1$s/images/setup/setup-content.gif"><img src="%1$s/images/setup/setup-content.gif" width="430" alt=""

					/></a>', get_template_directory_uri()) . '<p>' . sprintf('<a href="%s" class="button button-primary button-large">%s</a>', admin_url('import.php'), __('Begin Importing Content', 'listify')) . '</p>', 'documentation' => array('Install Demo Content' => 'http://listify.astoundify.com/article/236-installing-demo-content', 'Manually Add a Listing' => 'http://listify.astoundify.com/article/245-adding-a-listing', 'Importing Content (Codex)' => 'http://codex.wordpress.org/Importing_Content', 'WordPress Importer' => 'https://wordpress.org/plugins/wordpress-importer/')), 'import-widgets' => array('title' => __('Import Widgets', 'listify'), 'completed' => is_active_sidebar('widget-area-home'), 'description' => '<p>' . __('Importing the demo widgets is not required to use this theme. It simply allows you to quickly match the same settings found on our theme demo. If you do not import the widgets you can manually manage your widgets just like a standard WordPress widget area.', 'listify') . '</p>' . sprintf('<a href="%1$s/images/setup/setup-widgets.gif"><img src="%1$s/images/setup/setup-widgets.gif" width="430" alt="" /></a>', get_template_directory_uri()) . '<p>' . sprintf('<a href="%s" class="button button-primary button-large">%s</a>', admin_url('tools.php?page=widget-importer-exporter'), __('Begin Importing Widgets', 'listify')) . '</p>', 'documentation' => array('Widget Areas' => 'http://listify.astoundify.com/category/352-widget-areas', 'Widgets' => 'http://listify.astoundify.com/category/199-widgets')), 'setup-menus' => array('title' => __('Setup Menus', 'listify'), 'description' => '<p>' . __('Make sure you create and assign your menus to the menu locations found in the theme. This is required to use the custom mega menu dropdown, account item, and more.', 'listify') . '</p>' . sprintf('<a href="%1$s/images/setup/setup-menus.gif"><img src="%1$s/images/setup/setup-menus.gif" width="430" alt="" /></a>', get_template_directory_uri()) . '<p>' . sprintf('<a href="%s" class="button button-primary button-large">%s</a>', admin_url('nav-menus.php'), __('Manage Menus', 'listify')) . '</p>', 'completed' => isset($menus['primary']), 'documentation' => array('Primary Menu' => 'http://listify.astoundify.com/article/250-manage-the-primary-menu', 'Secondary Menu' => 'http://listify.astoundify.com/article/253-manage-the-secondary-menu', 'Tertiary Menu' => 'http://listify.astoundify.com/article/254-enable-the-tertiary-navigation', 'Add a Dropdown' => 'http://listify.astoundify.com/article/252-add-a-dropdown-menu', 'Add an Avatar' => 'http://listify.astoundify.com/article/251-add-the-avatar-menu-item', 'Adding Icons' => 'http://listify.astoundify.com/article/257-adding-icons-to-menu-items', 'Create a Popup' => 'http://listify.astoundify.com/article/255-creating-a-popup-menu-item', 'Show/Hide Items' => 'http://listify.astoundify.com/article/256-show-different-menus-for-logged-in-or-logged-out')), 'setup-homepage' => array('title' => __('Setup Static Homepage', 'listify'), 'description' => '<p>' . __('In order to display custom widgets on your homepage you must first assign your static page in the WordPress settings. You can also set which page will display your blog posts.', 'listify') . '</p>' . sprintf('<a href="%1$s/images/setup/setup-reading.gif"><img src="%1$s/images/setup/setup-reading.gif" width="430" alt="" /></a>', get_template_directory_uri()) . '<p>' . sprintf('<a href="%s" class="button button-primary button-large">%s</a>', admin_url('options-reading.php'), __('Reading Settings', 'listify')) . '</p>', 'completed' => get_option('page_on_front'), 'documentation' => array('Create Your Homepage' => 'http://listify.astoundify.com/article/261-creating-your-homepage', 'Reading Settings (codex)' => 'http://codex.wordpress.org/Settings_Reading_Screen')), 'setup-widgets' => array('title' => __('Setup Widgets', 'listify'), 'completed' => is_active_sidebar('widget-area-home'), 'description' => '<p>' . __('Manage your widgets to control what displays on your homepage, listing pages, standard pages, and more.', 'listify') . '</p>' . '<p>' . sprintf('<a href="%s" class="button button-primary button-large">%s</a>', admin_url('widgets.php'), __('Manage Widgets', 'listify')) . '</p>', 'documentation' => array('Widget Areas' => 'http://listify.astoundify.com/category/352-widget-areas', 'Widgets' => 'http://listify.astoundify.com/category/199-widgets')), 'customize-theme' => array('title' => __('Customize', 'listify'), 'description' => '<p>' . __('Manage the appearance and behavior of various theme components with the live customizer.', 'listify') . '</p>' . '<p>' . sprintf('<a href="%s" class="button button-primary button-large">%s</a>', admin_url('customize.php'), __('Customize', 'listify')) . '</p>', 'completed' => get_option('theme_mods_listify'), 'documentation' => array('Appearance' => 'http://listify.astoundify.com/category/334-appearance', 'Booking Services' => 'http://listify.astoundify.com/category/455-booking-service-integration', 'Child Themes' => 'http://listify.astoundify.com/category/209-child-themes', 'Translations' => 'http://listify.astoundify.com/category/210-translations')), 'support-us' => array('title' => __('Get Involved', 'listify'), 'description' => __('Help improve Listify by submitting a rating and helping to translate the theme to as many languages as possible!', 'listify'), 'completed' => true, 'documentation' => array('Leave a Positive Review' => 'http://bit.ly/rate-listify', 'Contribute Your Translation' => 'http://bit.ly/translate-listify')));
        add_action('admin_menu', array($this, 'add_page'), 100);
        add_action('admin_menu', array($this, 'add_meta_boxes'));
        add_action('admin_head', array($this, 'admin_css'));
    }
/**
 * Add widget support for homepage. If no widgets active, display the default loop.
 *
 */
function magazine_home_loop_helper()
{
    if (is_active_sidebar('home-top') || is_active_sidebar('home-left') || is_active_sidebar('home-right') || is_active_sidebar('home-bottom')) {
        if (is_active_sidebar('home-top')) {
            echo '<div class="home-top">';
            dynamic_sidebar('home-top');
            echo '</div><!-- end .home-top -->';
        }
        if (is_active_sidebar('home-left') || is_active_sidebar('home-right')) {
            echo '<div class="home-middle">';
            if (is_active_sidebar('home-left')) {
                echo '<div class="home-left">';
                dynamic_sidebar('home-left');
                echo '</div><!-- end .home-left -->';
            }
            if (is_active_sidebar('home-right')) {
                echo '<div class="home-right">';
                dynamic_sidebar('home-right');
                echo '</div><!-- end .home-right -->';
            }
            echo '</div><!-- end .home-middle -->';
        }
        if (is_active_sidebar('home-bottom')) {
            echo '<div class="home-bottom">';
            dynamic_sidebar('home-bottom');
            echo '</div><!-- end .home-bottom -->';
        }
    } else {
        genesis_standard_loop();
    }
}
    function _lbbee78bef56_content($_l, $_args)
    {
        extract($_args);
        ?>

<section class="section content-section blog-section not-found-section">

	<div id="container" class="subpage blog 404 wrapper <?php 
        if (is_active_sidebar("blog-sidebar")) {
        } else {
            ?>
onecolumn<?php 
        }
        ?>
">

		<div id="content" class="entry-content clearfix" role="main">
			<div class="content-wrapper">
<?php 
        NCoreMacros::includeTemplate("snippets/nothing-found.php", $template->getParams(), $_l->templates['pemu234rbc'])->render();
        ?>
			</div> <!-- /.content-wrapper -->
		</div> <!-- /#content -->

	</div> <!-- /#container -->

</section>

<?php 
    }
Example #13
0
function dln_template_blank_page()
{
    if (is_page_template('page-templates/blank-page.php') || is_attachment() || !is_active_sidebar('sidebar-1')) {
        global $content_width;
        $content_width = 960;
    }
}
 function jumbotron_content()
 {
     global $ss_settings, $ss_framework;
     $hero = false;
     $site_style = $ss_settings['site_style'];
     $visibility = $ss_settings['jumbotron_visibility'];
     $nocontainer = $ss_settings['jumbotron_nocontainer'];
     if (($visibility == 1 && is_front_page() || $visibility != 1) && is_active_sidebar('jumbotron')) {
         $hero = true;
     }
     if ($hero) {
         echo $ss_framework->clearfix();
         echo '<div class="before-main-wrapper">';
         if ($site_style == 'boxed' && $nocontainer != 1) {
             echo '<div class="' . Shoestrap_Layout::container_class() . '">';
         }
         echo '<div class="jumbotron">';
         if ($nocontainer != 1 && $site_style == 'wide' || $site_style == 'boxed') {
             echo '<div class="' . Shoestrap_Layout::container_class() . '">';
         }
         dynamic_sidebar('Jumbotron');
         if ($nocontainer != 1 && $site_style == 'wide' || $site_style == 'boxed') {
             echo '</div>';
         }
         echo '</div>';
         if ($site_style == 'boxed' && $nocontainer != 1) {
             echo '</div>';
         }
         echo '</div>';
     }
 }
Example #15
0
 function oriental_infinite_scroll_has_footer_widgets()
 {
     if (function_exists('jetpack_is_mobile') && jetpack_is_mobile('', true) && is_active_sidebar('sidebar-1')) {
         return true;
     }
     return false;
 }
Example #16
0
 function landscape_has_footer_widgets()
 {
     if (jetpack_is_mobile('', true) && is_active_sidebar('sidebar-1')) {
         return true;
     }
     return false;
 }
Example #17
0
/**
 * Do we have footer widgets?
 */
function twenty_ten_has_footer_widgets($has_widgets)
{
    if (is_active_sidebar('first-footer-widget-area') || is_active_sidebar('second-footer-widget-area') || is_active_sidebar('third-footer-widget-area') || is_active_sidebar('fourth-footer-widget-area')) {
        $has_widgets = true;
    }
    return $has_widgets;
}
Example #18
0
/**
 * Adjusts content_width value for few pages and attachment templates.
 */
function sela_content_width()
{
    global $content_width;
    if (is_page_template('page-templates/full-width-page.php') || is_page_template('page-templates/grid-page.php') || is_attachment() || !is_active_sidebar('sidebar-1')) {
        $content_width = 778;
    }
}
 /**
  * Widget area render function.
  *
  * @since  1.0.0
  * @param  string $area_id Widget area id.
  * @return void
  */
 public function render_widget_area($area_id)
 {
     if (!is_active_sidebar($area_id)) {
         return;
     }
     // Conditional page tags checking
     if (isset($this->widgets_settings[$area_id]['conditional']) && !empty($this->widgets_settings[$area_id]['conditional'])) {
         foreach ($this->widgets_settings[$area_id]['conditional'] as $conditional) {
             if (!call_user_func($conditional)) {
                 return;
             }
         }
     }
     $area_id = apply_filters('king_news_rendering_current_widget_area', $area_id);
     $before_wrapper = isset($this->widgets_settings[$area_id]['before_wrapper']) ? $this->widgets_settings[$area_id]['before_wrapper'] : '<div id="%1$s" %2$s>';
     $after_wrapper = isset($this->widgets_settings[$area_id]['after_wrapper']) ? $this->widgets_settings[$area_id]['after_wrapper'] : '</div>';
     $classes = array($area_id, 'widget-area');
     $classes = apply_filters('king_news_widget_area_classes', $classes, $area_id);
     if (is_array($classes)) {
         $classes = 'class="' . join(' ', $classes) . '"';
     }
     printf($before_wrapper, $area_id, $classes);
     dynamic_sidebar($area_id);
     printf($after_wrapper);
 }
Example #20
0
function wp_cta_replace_sidebars()
{
    global $_wp_sidebars_widgets, $post, $wp_registered_sidebars, $wp_registered_widgets;
    if (isset($post) && $post->post_type == 'wp-call-to-action') {
        $original_widgets = $_wp_sidebars_widgets;
        //print_r($original_widgets);exit;
        //print_r($wp_registered_sidebars);exit;
        //print_r($wp_registered_widgets);exit;
        //print_r($_wp_sidebars_widgets['wp_cta_sidebar']);exit;
        if (!is_active_sidebar('wp_cta_sidebar')) {
            $active_widgets = get_option('sidebars_widgets');
            $active_widgets['wp_cta_sidebar'] = array('0', 'id_wp_cta_conversion_area_widget-1');
            update_option('sidebars_widgets', $active_widgets);
        }
        $stop = 0;
        foreach ($original_widgets as $key => $val) {
            //$disable = apply_filters('wp_cta_disable_sidebar_removal', false);
            if (stristr($key, 'header') || stristr($key, 'footer') || stristr($key, 'wp_cta_sidebar') || stristr($key, 'wp_inactive_widgets') || stristr($key, 'wp_inactive_widgets') || stristr($key, 'array_version')) {
            } else {
                if (strstr($key, 'secondary')) {
                    unset($_wp_sidebars_widgets[$key]);
                } else {
                    //unset($_wp_sidebars_widgets[$key]);
                    $_wp_sidebars_widgets[$key] = $_wp_sidebars_widgets['wp_cta_sidebar'];
                    $stop = 1;
                }
            }
        }
        //print_r($_wp_sidebars_widgets);exit;
    }
}
Example #21
0
/**
 * Filter the 'infinite_scroll_has_footer_widgets' value.
 * If the navigation menu in the footer is used or if the footer sidebar contains any widgets, the scroll will be changed to 'click' from 'scroll'.
 */
function motif_infinite_scroll_has_footer_widgets($has_widgets)
{
    if (has_nav_menu('secondary') || is_active_sidebar('sidebar-2') || is_active_sidebar('sidebar-3') || is_active_sidebar('sidebar-4')) {
        $has_widgets = true;
    }
    return $has_widgets;
}
Example #22
0
function stachestack_footer_content()
{
    global $ss_framework;
    // Finding the number of active widget sidebars
    $num_of_sidebars = 0;
    for ($i = 0; $i < 5; $i++) {
        $sidebar = 'sidebar-footer-' . $i;
        if (is_active_sidebar($sidebar)) {
            $num_of_sidebars++;
        }
    }
    // If sidebars exist, open row.
    if ($num_of_sidebars >= 0) {
        echo $ss_framework->open_row('div');
    }
    // Showing the active sidebars
    for ($i = 0; $i < 5; $i++) {
        $sidebar = 'sidebar-footer-' . $i;
        if (is_active_sidebar($sidebar)) {
            // Setting each column width accordingly
            $col_class = 12 / $num_of_sidebars;
            echo $ss_framework->open_col('div', array('medium' => $col_class));
            dynamic_sidebar($sidebar);
            echo $ss_framework->close_col('div');
        }
    }
    // If sidebars exist, close row.
    if ($num_of_sidebars >= 0) {
        echo $ss_framework->close_row('div');
        // add a clearfix div.
        echo $ss_framework->clearfix();
    }
    do_action('stachestack_footer_html');
}
    /**
     * Sidebar
     *
     * @since eVision Corporate 1.0.0
     *
     * @param null
     * @return null
     *
     */
    function evision_corporate_sidebar()
    {
        global $evision_corporate_customizer_all_values;
        if (isset($evision_corporate_customizer_all_values['evision-corporate-layout-page'])) {
            $evision_corporate_layout_page = $evision_corporate_customizer_all_values['evision-corporate-layout-page'];
            if ('sidebar-no' == $evision_corporate_layout_page) {
                $evision_corporate_sidebar_active = 0;
            } else {
                $evision_corporate_sidebar_active = 1;
            }
        } else {
            $evision_corporate_sidebar_active = 1;
        }
        if (!is_active_sidebar('sidebar-1') || 0 == $evision_corporate_sidebar_active) {
            return;
        }
        ?>

    <div id="secondary" class="widget-area" role="complementary">
        <?php 
        dynamic_sidebar('sidebar-1');
        ?>
    </div><!-- #secondary -->
<?php 
    }
Example #24
0
 function penscratch_content_width()
 {
     global $content_width;
     if (is_page_template('fullwidth-page.php') && is_active_sidebar('sidebar-1')) {
         $content_width = 937;
     }
 }
Example #25
0
 function woothemes_add_javascript()
 {
     $suffix = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '' : '.min';
     wp_enqueue_script('third-party', get_template_directory_uri() . '/includes/js/third-party' . $suffix . '.js', array('jquery'));
     wp_register_script('flexslider', get_template_directory_uri() . '/includes/js/jquery.flexslider' . $suffix . '.js', array('jquery'));
     wp_register_script('prettyPhoto', get_template_directory_uri() . '/includes/js/jquery.prettyPhoto' . $suffix . '.js', array('jquery'));
     wp_register_script('portfolio', get_template_directory_uri() . '/includes/js/portfolio' . $suffix . '.js', array('jquery', 'prettyPhoto'));
     wp_enqueue_script('modernizr', get_template_directory_uri() . '/includes/js/modernizr' . $suffix . '.js', array('jquery'), '2.6.2');
     // Conditionally load the Slider and Portfolio JavaScript, where needed.
     $load_slider_js = false;
     $load_portfolio_js = false;
     if (get_option('woo_slider_magazine') == 'true' && is_page_template('template-magazine.php') || get_option('woo_slider_biz') == 'true' && is_page_template('template-biz.php') || is_page_template('template-widgets.php') || is_active_sidebar('homepage') && (is_home() || is_front_page())) {
         $load_slider_js = true;
     }
     if (is_page_template('template-portfolio.php') || is_singular() && get_post_type() == 'portfolio' || is_post_type_archive('portfolio') || is_tax('portfolio-gallery')) {
         $load_portfolio_js = true;
     }
     // Allow child themes/plugins to load the slider and portfolio JavaScript when they need it.
     $load_slider_js = apply_filters('woo_load_slider_js', $load_slider_js);
     $load_portfolio_js = apply_filters('woo_load_portfolio_js', $load_portfolio_js);
     if ($load_slider_js) {
         wp_enqueue_script('flexslider');
     }
     if ($load_portfolio_js) {
         wp_enqueue_script('portfolio');
     }
     do_action('woothemes_add_javascript');
     wp_enqueue_script('general', get_template_directory_uri() . '/includes/js/general' . $suffix . '.js', array('jquery', 'third-party'));
 }
/**
 * Check whether or not footer widgets are present. If they are present, then a button to
 * 'Load more posts' will be displayed and Infinite Scroll will not be triggered unless a user manually clicks on that button.
 *
 * @param bool $has_widgets
 * @uses Jetpack_User_Agent_Info::is_ipad, jetpack_is_mobile, is_active_sidebar
 * @filter infinite_scroll_has_footer_widgets
 * @return bool
 */
function tinyframework_has_footer_widgets($has_widgets)
{
    if ((Jetpack_User_Agent_Info::is_ipad() || function_exists('jetpack_is_mobile') && jetpack_is_mobile()) && is_active_sidebar('sidebar-1')) {
        $has_widgets = true;
    }
    return $has_widgets;
}
Example #27
0
/**
 * Check whether or not footer widgets are present. If they are present, then a button to
 * 'Load more posts' will be displayed and IS will not be triggered unless a user manually clicks on that button.
 *
 * @param bool $has_widgets
 * @uses Jetpack_User_Agent_Info::is_ipad, jetpack_is_mobile, is_active_sidebar
 * @filter infinite_scroll_has_footer_widgets
 * @return bool
 */
function encounters_lite_has_footer_widgets($has_widgets)
{
    if ((Jetpack_User_Agent_Info::is_ipad() || function_exists('jetpack_is_mobile') && jetpack_is_mobile()) && is_active_sidebar('bottom1')) {
        $has_widgets = true;
    }
    return $has_widgets;
}
/**
 * Count the number of footer sidebars to enable dynamic classes for the footer
 *
 * @since aThemes 1.0
 */
function athemes_footer_sidebar_class()
{
    $count = 0;
    if (is_active_sidebar('sidebar-3')) {
        $count++;
    }
    if (is_active_sidebar('sidebar-4')) {
        $count++;
    }
    if (is_active_sidebar('sidebar-5')) {
        $count++;
    }
    if (is_active_sidebar('sidebar-6')) {
        $count++;
    }
    $class = '';
    switch ($count) {
        case '1':
            $class = 'container site-extra extra-one';
            break;
        case '2':
            $class = 'container site-extra extra-two';
            break;
        case '3':
            $class = 'container site-extra extra-three';
            break;
        case '4':
            $class = 'container site-extra extra-four';
            break;
    }
    if ($class) {
        echo 'class="' . $class . '"';
    }
}
Example #29
0
/**
 * understrap enqueue scripts
 *
 * @package understrap
 */
function understrap_scripts()
{
    // wp_enqueue_style( 'understrap-theme', get_stylesheet_directory_uri() . '/css/theme.min.css', array(), '0.2.8', false );
    wp_enqueue_style('understrap-theme', get_stylesheet_directory_uri() . '/css/theme.css', array(), '0.2.8', false);
    // wp_enqueue_script('jquery');
    wp_enqueue_script('jquery', get_template_directory_uri() . '/js/jquery.js', array(), '2.1.4', false);
    wp_enqueue_script('understrap-navigation', get_template_directory_uri() . '/js/bootstrap.min.js', array(), '20120206', true);
    wp_enqueue_script('understrap-skip-link-focus-fix', get_template_directory_uri() . '/js/skip-link-focus-fix.js', array(), '20130115', true);
    // angular relations
    wp_enqueue_script('angular', get_template_directory_uri() . '/js/angular.js', array(), '1.4.9', true);
    wp_enqueue_script('angular-ui-router', '//cdnjs.cloudflare.com/ajax/libs/angular-ui-router/0.2.17/angular-ui-router.min.js', array(), '0.2.17', true);
    wp_enqueue_script('angular-animate', '//ajax.googleapis.com/ajax/libs/angularjs/1.4.9/angular-animate.js', array(), '1.4.9', true);
    wp_enqueue_script('angular-sanitize', '//ajax.googleapis.com/ajax/libs/angularjs/1.4.9/angular-sanitize.min.js', array(), '1.4.9', true);
    wp_enqueue_script('ui-bootstrap', '//angular-ui.github.io/bootstrap/ui-bootstrap-tpls-1.1.2.js', array(), '1.1.2', true);
    // Angualr APP
    wp_enqueue_script('app', get_template_directory_uri() . '/js/app.js', array(), null, true);
    // Custom JS
    wp_enqueue_script('script', get_template_directory_uri() . '/js/script.js', array(), null, true);
    // NON SASS CSS
    wp_enqueue_style('animate', get_stylesheet_directory_uri() . '/css/animate.css', array(), '0.2.8', false);
    if (is_singular() && comments_open() && get_option('thread_comments')) {
        wp_enqueue_script('comment-reply');
    }
    if (is_active_sidebar('hero')) {
        wp_enqueue_style('understrap-carousel-style', get_template_directory_uri() . '/css/owl.carousel.css', array(), '20024', false);
        wp_enqueue_script('understrap-carousel-script', get_template_directory_uri() . '/js/owl.carousel.min.js', array(), '20024', true);
    }
}
Example #30
0
/**
 * Echos the markup necessary to facilitate the footer widget areas.
 *
 * Checks for a numerical parameter given when adding theme support - if none is
 * found, then the function returns early.
 *
 * The child theme must style the widget areas.
 *
 * @since 1.6.0
 *
 * @return null Returns early if number of widget areas could not be determined,
 * or nothing is added to the first widget area
 */
function genesis_footer_widget_areas()
{
    $footer_widgets = get_theme_support('genesis-footer-widgets');
    if (!$footer_widgets || !isset($footer_widgets[0]) || !is_numeric($footer_widgets[0])) {
        return;
    }
    $footer_widgets = (int) $footer_widgets[0];
    /**
     * Check to see if first widget area has widgets. If not,
     * do nothing. No need to check all footer widget areas.
     */
    if (!is_active_sidebar('footer-1')) {
        return;
    }
    $output = '';
    $counter = 1;
    while ($counter <= $footer_widgets) {
        /** Darn you, WordPress! Gotta output buffer. */
        ob_start();
        dynamic_sidebar('footer-' . $counter);
        $widgets = ob_get_clean();
        $output .= sprintf('<div class="footer-widgets-%d widget-area">%s</div>', $counter, $widgets);
        $counter++;
    }
    echo apply_filters('genesis_footer_widget_areas', sprintf('<div id="footer-widgets" class="footer-widgets">%2$s%1$s%3$s</div>', $output, genesis_structural_wrap('footer-widgets', 'open', 0), genesis_structural_wrap('footer-widgets', 'close', 0)));
}