function jumbotron_widget_area_callback()
{
    if (is_active_sidebar('jumbotron-widget-area')) {
        ?>
<header <?php 
        echo genesis_attr('jumbotron-header');
        ?>
>
	<?php 
        genesis_structural_wrap('jumbotron-outer');
        ?>
        	<div class="jumbotron">
                	<?php 
        genesis_structural_wrap('jumbotron-inner');
        ?>
                    		<?php 
        dynamic_sidebar('jumbotron-widget-area');
        ?>
                	<?php 
        genesis_structural_wrap('jumbotron-inner', 'close');
        ?>
            	</div>
        <?php 
        genesis_structural_wrap('jumbotron-outer', close);
        ?>
</header>
<?php 
    }
}
Ejemplo n.º 2
0
/**
 * Output markup conditionally.
 *
 * Supported keys for `$args` are:
 *
 *  - `html5` (`sprintf()` pattern markup),
 *  - `xhtml` (XHTML markup),
 *  - `context` (name of context),
 *  - `echo` (default is true).
 *
 * If the child theme supports HTML5, then this function will output the `html5` value, with a call to `genesis_attr()`
 * with the same context added in. Otherwise, it will output the `xhtml` value.
 *
 * Applies a `genesis_markup_{context}` filter early to allow shortcutting the function.
 *
 * Applies a `genesis_markup_{context}_output` filter at the end.
 *
 * @since 1.9.0
 *
 * @uses genesis_html5() Check for HTML5 support.
 * @uses genesis_attr()  Contextual attributes.
 *
 * @param array $args Array of arguments.
 *
 * @return string Markup.
 */
function genesis_markup($args = array())
{
    $defaults = array('html5' => '', 'xhtml' => '', 'context' => '', 'echo' => true);
    $args = wp_parse_args($args, $defaults);
    //* Short circuit filter
    $pre = apply_filters('genesis_markup_' . $args['context'], false, $args);
    if (false !== $pre) {
        return $pre;
    }
    if (!$args['html5'] || !$args['xhtml']) {
        return '';
    }
    //* If HTML5, return HTML5 tag. Maybe add attributes. Else XHTML.
    if (genesis_html5()) {
        $tag = $args['context'] ? sprintf($args['html5'], genesis_attr($args['context'])) : $args['html5'];
    } else {
        $tag = $args['xhtml'];
    }
    //* Contextual filter
    $tag = $args['context'] ? apply_filters('genesis_markup_' . $args['context'] . '_output', $tag, $args) : $tag;
    if ($args['echo']) {
        echo $tag;
    } else {
        return $tag;
    }
}
/**
 * Add structural-wrap replacement utility function to use 
 * Bootstrap responsive .container class
 *
 * Useage: add_filter( 'genesis_structural_wrap-{$context}', 'bsg_util_structural_wrap_container_fluid');
 */
function bsg_util_structural_wrap_container_fluid($output, $original_output)
{
    if ($original_output == 'open') {
        $output = sprintf('<div %s>', genesis_attr('container-fluid'));
    }
    return $output;
}
function zp_custom_blog_page()
{
    global $post, $paged;
    $include = genesis_get_option('blog_cat');
    $exclude = genesis_get_option('blog_cat_exclude') ? explode(',', str_replace(' ', '', genesis_get_option('blog_cat_exclude'))) : '';
    if (get_query_var('paged')) {
        $paged = get_query_var('paged');
    } elseif (get_query_var('page')) {
        $paged = get_query_var('page');
    } else {
        $paged = 1;
    }
    //* Arguments
    $args = array('cat' => $include, 'category__not_in' => $exclude, 'posts_per_page' => genesis_get_option('blog_cat_num'), 'paged' => $paged);
    query_posts($args);
    if (have_posts()) {
        while (have_posts()) {
            the_post();
            do_action('genesis_before_entry');
            printf('<article %s>', genesis_attr('entry'));
            // check post format and call template
            $format = get_post_format();
            get_template_part('content', $format);
            do_action('genesis_after_entry_content');
            //do_action( 'genesis_entry_footer' );
            echo '</article>';
            do_action('genesis_after_entry');
        }
    }
    //* Genesis navigation
    genesis_posts_nav();
    //* Restore original query
    wp_reset_query();
}
function zp_custom_archive_page()
{
    global $post, $paged;
    $include = genesis_get_option('blog_cat');
    $exclude = genesis_get_option('blog_cat_exclude') ? explode(',', str_replace(' ', '', genesis_get_option('blog_cat_exclude'))) : '';
    $paged = get_query_var('paged') ? get_query_var('paged') : 1;
    if (have_posts()) {
        while (have_posts()) {
            the_post();
            do_action('genesis_before_entry');
            printf('<article %s>', genesis_attr('entry'));
            // check post format and call template
            $format = get_post_format();
            get_template_part('content', $format);
            do_action('genesis_after_entry_content');
            //do_action( 'genesis_entry_footer' );
            echo '</article>';
            do_action('genesis_after_entry');
        }
    }
    //* Genesis navigation
    genesis_posts_nav();
    //* Restore original query
    wp_reset_query();
}
function bfg_breadcrumb_args($args)
{
    $args['sep'] = '     ';
    $args['prefix'] = sprintf('<ol %s>', genesis_attr('breadcrumb'));
    $args['suffix'] = '</ol>';
    return $args;
}
Ejemplo n.º 7
0
/**
 * Replace the default search form with a Genesis-specific form.
 *
 * The exact output depends on whether the child theme supports HTML5 or not.
 *
 * Applies the `genesis_search_text`, `genesis_search_button_text`, `genesis_search_form_label` and
 * `genesis_search_form` filters.
 *
 * @since 0.2.0
 *
 * @uses genesis_html5() Check for HTML5 support.
 *
 * @return string HTML markup.
 */
function genesis_search_form()
{
    $search_text = get_search_query() ? apply_filters('the_search_query', get_search_query()) : apply_filters('genesis_search_text', __('Search this website', 'genesis') . ' &#x02026;');
    $button_text = apply_filters('genesis_search_button_text', esc_attr__('Search', 'genesis'));
    $onfocus = "if ('" . esc_js($search_text) . "' === this.value) {this.value = '';}";
    $onblur = "if ('' === this.value) {this.value = '" . esc_js($search_text) . "';}";
    //* Empty label, by default. Filterable.
    $label = apply_filters('genesis_search_form_label', '');
    $value_or_placeholder = get_search_query() == '' ? 'placeholder' : 'value';
    if (genesis_html5()) {
        $form = sprintf('<form %s>', genesis_attr('search-form'));
        if (genesis_a11y('search-form')) {
            if ('' == $label) {
                $label = apply_filters('genesis_search_text', __('Search this website', 'genesis'));
            }
            $form_id = uniqid('searchform-');
            $form .= sprintf('<meta itemprop="target" content="%s"/><label class="search-form-label screen-reader-text" for="%s">%s</label><input itemprop="query-input" type="search" name="s" id="%s" %s="%s" /><input type="submit" value="%s" /></form>', home_url('/?s={s}'), esc_attr($form_id), esc_html($label), esc_attr($form_id), $value_or_placeholder, esc_attr($search_text), esc_attr($button_text));
        } else {
            $form .= sprintf('%s<meta itemprop="target" content="%s"/><input itemprop="query-input" type="search" name="s" %s="%s" /><input type="submit" value="%s"  /></form>', esc_html($label), home_url('/?s={s}'), $value_or_placeholder, esc_attr($search_text), esc_attr($button_text));
        }
    } else {
        $form = sprintf('<form method="get" class="searchform search-form" action="%s" role="search" >%s<input type="text" value="%s" name="s" class="s search-input" onfocus="%s" onblur="%s" /><input type="submit" class="searchsubmit search-submit" value="%s" /></form>', home_url('/'), esc_html($label), esc_attr($search_text), esc_attr($onfocus), esc_attr($onblur), esc_attr($button_text));
    }
    return apply_filters('genesis_search_form', $form, $search_text, $button_text, $label);
}
Ejemplo n.º 8
0
/**
 * Standard loop, meant to be executed without modification in most circumstances where content needs to be displayed.
 *
 * It outputs basic wrapping HTML, but uses hooks to do most of its content output like title, content, post information
 * and comments.
 *
 * The action hooks called are:
 *
 *  - `genesis_before_entry`
 *  - `genesis_entry_header`
 *  - `genesis_before_entry_content`
 *  - `genesis_entry_content`
 *  - `genesis_after_entry_content`
 *  - `genesis_entry_footer`
 *  - `genesis_after_endwhile`
 *  - `genesis_loop_else` (only if no posts were found)
 *
 * @since 1.1.0
 *
 * @uses genesis_html5()       Check for HTML5 support.
 * @uses genesis_legacy_loop() XHTML loop.
 * @uses genesis_attr()        Contextual attributes.
 *
 * @return null Return early after legacy loop if not supporting HTML5.
 */
function genesis_standard_loop()
{
    //* Use old loop hook structure if not supporting HTML5
    if (!genesis_html5()) {
        genesis_legacy_loop();
        return;
    }
    if (have_posts()) {
        do_action('genesis_before_while');
        while (have_posts()) {
            the_post();
            do_action('genesis_before_entry');
            printf('<article %s>', genesis_attr('entry'));
            do_action('genesis_entry_header');
            do_action('genesis_before_entry_content');
            printf('<div %s>', genesis_attr('entry-content'));
            do_action('genesis_entry_content');
            echo '</div>';
            do_action('genesis_after_entry_content');
            do_action('genesis_entry_footer');
            echo '</article>';
            do_action('genesis_after_entry');
        }
        //* end of one post
        do_action('genesis_after_endwhile');
    } else {
        //* if no posts exist
        do_action('genesis_loop_else');
    }
    //* end loop
}
function zp_404_page()
{
    ?>

<article class="page type-page status-publish entry">

	<div class="post entry">

		<?php 
    printf('<div %s>', genesis_attr('entry-content'));
    ?>
        	<h1 class="entrytitle"><?php 
    _e('404 - Page Not Found!', 'amelie');
    ?>
</h1>
			<p><?php 
    printf(__('You\'re looking for a page that does not exist! Please try the navigations above..', 'amelie'));
    ?>
</p>

<?php 
    echo '</div>';
    //* end .entry-content
    echo '</div>';
    ?>
    
</article>

<?php 
}
Ejemplo n.º 10
0
function sk_show_posts()
{
    if (is_front_page()) {
        printf('<div %s>', genesis_attr('home-below-content'));
        genesis_widget_area('home-below-content');
        echo '</div>';
    }
}
Ejemplo n.º 11
0
/**
 * Display content for the "Home Gallery" section.
 *
 * @since 1.0.0
 */
function utility_pro_add_home_gallery()
{
    printf('<div %s>', genesis_attr('home-gallery'));
    genesis_structural_wrap('home-gallery');
    genesis_widget_area('utility-home-gallery-1', array('before' => '<div class="home-gallery-1 widget-area">', 'after' => '</div>'));
    genesis_widget_area('utility-home-gallery-2', array('before' => '<div class="home-gallery-2 widget-area">', 'after' => '</div>'));
    genesis_widget_area('utility-home-gallery-3', array('before' => '<div class="home-gallery-3 widget-area">', 'after' => '</div>'));
    genesis_widget_area('utility-home-gallery-4', array('before' => '<div class="home-gallery-4 widget-area">', 'after' => '</div>'));
    genesis_structural_wrap('home-gallery', 'close');
    echo '</div>';
}
Ejemplo n.º 12
0
function custom_header_inline_logo($title, $inside, $wrap)
{
    $logo = '<img src="' . get_stylesheet_directory_uri() . '/images/logo.png" alt="' . esc_attr(get_bloginfo('name')) . '" title="' . esc_attr(get_bloginfo('name')) . '" width="359" height="72" />';
    $inside = sprintf('<a href="%s" title="%s">%s</a>', trailingslashit(home_url()), esc_attr(get_bloginfo('name')), $logo);
    // Determine which wrapping tags to use - changed is_home to is_front_page to fix Genesis bug
    $wrap = is_front_page() && 'title' === genesis_get_seo_option('home_h1_on') ? 'h1' : 'p';
    // A little fallback, in case an SEO plugin is active - changed is_home to is_front_page to fix Genesis bug
    $wrap = is_front_page() && !genesis_get_seo_option('home_h1_on') ? 'h1' : $wrap;
    // And finally, $wrap in h1 if HTML5 & semantic headings enabled
    $wrap = genesis_html5() && genesis_get_seo_option('semantic_headings') ? 'h1' : $wrap;
    return sprintf('<%1$s %2$s>%3$s</%1$s>', $wrap, genesis_attr('site-title'), $inside);
}
Ejemplo n.º 13
0
function minimum_home_featured()
{
    printf('<div %s>', genesis_attr('home-featured'));
    genesis_structural_wrap('home-featured');
    genesis_widget_area('home-featured-1', array('before' => '<div class="home-featured-1 widget-area">', 'after' => '</div>'));
    genesis_widget_area('home-featured-2', array('before' => '<div class="home-featured-2 widget-area">', 'after' => '</div>'));
    genesis_widget_area('home-featured-3', array('before' => '<div class="home-featured-3 widget-area">', 'after' => '</div>'));
    genesis_widget_area('home-featured-4', array('before' => '<div class="home-featured-4 widget-area">', 'after' => '</div>'));
    genesis_structural_wrap('home-featured', 'close');
    echo '</div>';
    //* end .home-featured
}
function uci_genesis_site_description()
{
    //* Set what goes inside the wrapping tags
    $inside = esc_html(get_bloginfo('description'));
    //* Determine which wrapping tags to use
    $wrap = 'p';
    //* Build the description
    $description = genesis_html5() ? sprintf("<{$wrap} %s>", genesis_attr('site-description')) : sprintf('<%s id="description">%s</%s>', $wrap, $inside, $wrap);
    $description .= genesis_html5() ? "{$inside}</{$wrap}>" : '';
    //* Output (filtered)
    $output = $inside ? apply_filters('uci_genesis_site_description', $description, $inside, $wrap) : '';
    echo $output;
}
Ejemplo n.º 15
0
function minimum_site_tagline()
{
    printf('<div %s>', genesis_attr('site-tagline'));
    genesis_structural_wrap('site-tagline');
    printf('<div %s>', genesis_attr('site-tagline-left'));
    printf('<p %s>%s</p>', genesis_attr('site-description'), esc_html(get_bloginfo('description')));
    echo '</div>';
    printf('<div %s>', genesis_attr('site-tagline-right'));
    genesis_widget_area('site-tagline-right');
    echo '</div>';
    genesis_structural_wrap('site-tagline', 'close');
    echo '</div>';
}
/**
 * Return the markup to display a menu consistent with the Genesis format.
 *
 * Applies the `genesis_$location_nav` filter e.g. `genesis_header_nav`. For primary and secondary menu locations, it
 * also applies the `genesis_do_nav` and `genesis_do_subnav` filters for backwards compatibility.
 *
 * @since 2.1.0
 *
 * @uses genesis_markup()             Contextual markup.
 * @uses genesis_html5()              Check for HTML5 support.
 * @uses genesis_structural_wrap()    Adds optional internal wrap divs.
 *
 * @param string $args Menu arguments.
 *
 * @return string Navigation menu markup.
 */
function genesis_get_nav_menu($args = array())
{
    $args = wp_parse_args($args, array('theme_location' => '', 'container' => '', 'menu_class' => 'menu genesis-nav-menu', 'link_before' => genesis_html5() ? sprintf('<span %s>', genesis_attr('nav-link-wrap')) : '', 'link_after' => genesis_html5() ? '</span>' : '', 'echo' => 0));
    //* If a menu is not assigned to theme location, abort
    if (!has_nav_menu($args['theme_location'])) {
        return;
    }
    $sanitized_location = sanitize_key($args['theme_location']);
    $nav = wp_nav_menu($args);
    //* Do nothing if there is nothing to show
    if (!$nav) {
        return;
    }
    $xhtml_id = $args['theme_location'];
    if ('primary' === $args['theme_location']) {
        $xhtml_id = 'nav';
    } elseif ('secondary' === $args['theme_location']) {
        $xhtml_id = 'subnav';
    }
    $nav_markup_open = genesis_markup(array('html5' => '<nav %s>', 'xhtml' => '<div id="' . $xhtml_id . '">', 'context' => 'nav-' . $sanitized_location, 'echo' => false));
    $nav_markup_open .= genesis_structural_wrap('menu-' . $sanitized_location, 'open', 0);
    $nav_markup_close = genesis_structural_wrap('menu-' . $sanitized_location, 'close', 0);
    $nav_markup_close .= genesis_html5() ? '</nav>' : '</div>';
    $nav_output = $nav_markup_open . $nav . $nav_markup_close;
    $filter_location = 'genesis_' . $sanitized_location . '_nav';
    //* Handle back-compat for primary and secondary nav filters.
    if ('primary' === $args['theme_location']) {
        $filter_location = 'genesis_do_nav';
    } elseif ('secondary' === $args['theme_location']) {
        $filter_location = 'genesis_do_subnav';
    }
    /**
     * Filter the navigation markup.
     *
     * @since 2.1.0
     *
     * @param string $nav_output Opening container markup, nav, closing container markup.
     * @param string $nav Navigation list (`<ul>`).
     * @param array $args {
     *     Arguments for `wp_nav_menu()`.
     *
     *     @type string $theme_location Menu location ID.
     *     @type string $container Container markup.
     *     @type string $menu_class Class(es) applied to the `<ul>`.
     *     @type bool $echo 0 to indicate `wp_nav_menu()` should return not echo.
     * }
     */
    return apply_filters($filter_location, $nav_output, $nav, $args);
}
Ejemplo n.º 17
0
/**
 * Output markup conditionally.
 *
 * Supported keys for `$args` are:
 *
 *  - `html5` (`sprintf()` pattern markup),
 *  - `xhtml` (XHTML markup),
 *  - `context` (name of context),
 *  - `echo` (default is true).
 *
 * If the child theme supports HTML5, then this function will output the `html5` value, with a call to `genesis_attr()`
 * with the same context added in. Otherwise, it will output the `xhtml` value.
 *
 * Applies a `genesis_markup_{context}` filter early to allow shortcutting the function.
 *
 * Applies a `genesis_markup_{context}_output` filter at the end.
 *
 * @since 1.9.0
 *
 * @param array $args Array of arguments.
 * @return string Markup.
 */
function genesis_markup($args = array())
{
    $defaults = array('html5' => '', 'xhtml' => '', 'context' => '', 'open' => '', 'close' => '', 'content' => '', 'echo' => true);
    $args = wp_parse_args($args, $defaults);
    // Short circuit filter.
    $pre = apply_filters("genesis_markup_{$args['context']}", false, $args);
    if (false !== $pre) {
        if (!$args['echo']) {
            return $pre;
        }
        echo $pre;
        return;
    }
    if ($args['html5'] || $args['xhtml']) {
        // If HTML5, return HTML5 tag. Maybe add attributes. Else XHTML.
        if (genesis_html5()) {
            $tag = $args['context'] ? sprintf($args['html5'], genesis_attr($args['context'])) : $args['html5'];
        } else {
            $tag = $args['xhtml'];
        }
        // Contextual filter.
        $tag = $args['context'] ? apply_filters("genesis_markup_{$args['context']}_output", $tag, $args) : $tag;
        if (!$args['echo']) {
            return $tag;
        }
        echo $tag;
        return;
    }
    // Add attributes to open tag.
    if ($args['context']) {
        $open = sprintf($args['open'], genesis_attr($args['context']));
        $open = apply_filters("genesis_markup_{$args['context']}_open", $open, $args);
        $close = apply_filters("genesis_markup_{$args['context']}_close", $args['close'], $args);
    } else {
        $open = $args['open'];
        $close = $args['close'];
    }
    if ($args['content'] || $open) {
        $open = apply_filters('genesis_markup_open', $open, $args);
    }
    if ($args['content'] || $close) {
        $close = apply_filters('genesis_markup_close', $close, $args);
    }
    if ($args['echo']) {
        echo $open . $args['content'] . $close;
    } else {
        return $open . $args['content'] . $close;
    }
}
Ejemplo n.º 18
0
/**
 * Return the markup to display a menu consistent with the Genesis format.
 *
 * Applies the `genesis_$location_nav` filter e.g. `genesis_header_nav`. For primary and secondary menu locations, it
 * applies the `genesis_do_nav` and `genesis_do_subnav` filters instead for backwards compatibility.
 *
 * @since 2.1.0
 *
 * @param string|array $args Menu arguments.
 * @return string|null Navigation menu markup, or `null` if menu is not assigned to theme location, there is
 *                     no menu, or there are no menu items in the menu.
 */
function genesis_get_nav_menu($args = array())
{
    $args = wp_parse_args($args, array('theme_location' => '', 'container' => '', 'menu_class' => 'menu genesis-nav-menu', 'link_before' => genesis_html5() ? sprintf('<span %s>', genesis_attr('nav-link-wrap')) : '', 'link_after' => genesis_html5() ? '</span>' : '', 'echo' => 0));
    // If a menu is not assigned to theme location, abort.
    if (!has_nav_menu($args['theme_location'])) {
        return;
    }
    // If genesis-accessibility for 'drop-down-menu' is enabled and the menu doesn't already have the superfish class, add it.
    if (genesis_superfish_enabled() && false === strpos($args['menu_class'], 'js-superfish')) {
        $args['menu_class'] .= ' js-superfish';
    }
    $sanitized_location = sanitize_key($args['theme_location']);
    $nav = wp_nav_menu($args);
    // Do nothing if there is nothing to show.
    if (!$nav) {
        return;
    }
    $nav_markup_open = genesis_structural_wrap('menu-' . $sanitized_location, 'open', 0);
    $nav_markup_close = genesis_structural_wrap('menu-' . $sanitized_location, 'close', 0);
    $params = array('theme_location' => $args['theme_location']);
    $nav_output = genesis_markup(array('open' => '<nav %s>', 'close' => '</nav>', 'context' => 'nav-' . $sanitized_location, 'content' => $nav_markup_open . $nav . $nav_markup_close, 'echo' => false, 'params' => $params));
    $filter_location = 'genesis_' . $sanitized_location . '_nav';
    // Handle back-compat for primary and secondary nav filters.
    if ('primary' === $args['theme_location']) {
        $filter_location = 'genesis_do_nav';
    } elseif ('secondary' === $args['theme_location']) {
        $filter_location = 'genesis_do_subnav';
    }
    /**
     * Filter the navigation markup.
     *
     * @since 2.1.0
     *
     * @param string $nav_output Opening container markup, nav, closing container markup.
     * @param string $nav Navigation list (`<ul>`).
     * @param array $args {
     *     Arguments for `wp_nav_menu()`.
     *
     *     @type string $theme_location Menu location ID.
     *     @type string $container Container markup.
     *     @type string $menu_class Class(es) applied to the `<ul>`.
     *     @type bool $echo 0 to indicate `wp_nav_menu()` should return not echo.
     * }
     */
    return apply_filters($filter_location, $nav_output, $nav, $args);
}
function zp_custom_single_template()
{
    global $post, $paged;
    if (have_posts()) {
        while (have_posts()) {
            the_post();
            do_action('genesis_before_entry');
            printf('<article %s>', genesis_attr('entry'));
            // check post format and call template
            $format = get_post_format();
            get_template_part('content', $format);
            do_action('genesis_after_entry_content');
            do_action('genesis_entry_footer');
            echo '</article>';
            do_action('genesis_after_entry');
        }
    }
}
/**
 * Echo the site title into the header.
 *
 * Depending on the SEO option set by the user, this will either be wrapped in an `h1` or `p` element.
 *
 * Applies the `genesis_seo_title` filter before echoing.
 *
 * @since 1.1.0
 *
 * @uses genesis_get_seo_option() Get SEO setting value.
 * @uses genesis_html5()          Check or HTML5 support.
 */
function ygf_seo_site_title()
{
    // Set what goes inside the wrapping tags
    $inside = sprintf('<a href="%s" class="menu-text">%s</a>', trailingslashit(home_url()), get_bloginfo('name'));
    // Determine which wrapping tags to use
    $wrap = is_home() && 'title' === genesis_get_seo_option('home_h1_on') ? 'h1' : 'h1';
    // A little fallback, in case an SEO plugin is active
    $wrap = is_home() && !genesis_get_seo_option('home_h1_on') ? 'h1' : $wrap;
    // And finally, $wrap in h1 if HTML5 & semantic headings enabled
    $wrap = genesis_html5() && genesis_get_seo_option('semantic_headings') ? 'h1' : $wrap;
    // Build the title
    $title = genesis_html5() ? sprintf("<li class='name'><{$wrap} %s>", genesis_attr('site-title')) : sprintf('<%s id="title">%s</%s>', $wrap, $inside, $wrap);
    $title .= genesis_html5() ? "{$inside}</{$wrap}></li>" : '';
    if (!has_nav_menu('mobile-off-canvas')) {
        $title .= '<li class="toggle-topbar menu-icon"><a href="#"><span>Menu</span></a></li>';
    }
    // Echo (filtered)
    echo apply_filters('genesis_seo_title', $title, $inside, $wrap);
}
function gmdl_mdl_search_form()
{
    $search_text = get_search_query() ? apply_filters('the_search_query', get_search_query()) : apply_filters('genesis_search_text', __('Search this website', 'genesis-material-design-lite-child-theme') . ' &#x02026;');
    $button_text = apply_filters('genesis_search_button_text', esc_attr__('Search', 'genesis-material-design-lite-child-theme'));
    $onfocus = "if ('" . esc_js($search_text) . "' === this.value) {this.value = '';}";
    $onblur = "if ('' === this.value) {this.value = '" . esc_js($search_text) . "';}";
    //* Empty label, by default. Filterable.
    $label = apply_filters('genesis_search_form_label', '');
    $value_or_placeholder = get_search_query() == '' ? 'placeholder' : 'value';
    if (genesis_html5()) {
        $form = sprintf('<form %s>', genesis_attr('search-form'));
        if ('' == $label) {
            $label = apply_filters('genesis_search_text', __('Search this website', 'genesis-material-design-lite-child-theme'));
        }
        $form_id = uniqid('searchform-');
        $form .= sprintf('<div class="mdl-textfield mdl-js-textfield mdl-textfield--expandable"><meta itemprop="target" content="%s"/><label class="search-form-label mdl-button mdl-js-button mdl-button--icon" for="%s"><i class="material-icons">search</i></label><div class="mdl-textfield__expandable-holder"><input itemprop="query-input" type="search" name="s" class="mdl-textfield__input" id="%s" %s="%s" /></div></div></form>', home_url('/?s={s}'), esc_attr($form_id), esc_attr($form_id), $value_or_placeholder, esc_attr($search_text));
    } else {
        $form = sprintf('<form method="get" class="searchform search-form" action="%s" role="search" ><div class="mdl-textfield mdl-js-textfield mdl-textfield--expandable"><label class="search-form-label mdl-button mdl-js-button mdl-button--icon" for="%s"><i class="material-icons">search</i></label><div class="mdl-textfield__expandable-holder"><input class="mdl-textfield__input s search-input" type="text" name="s" "id="%s" value="%s" onfocus="%s" onblur="%s /></div></div></form>', home_url('/'), esc_attr($form_id), esc_attr($form_id), esc_attr($search_text), esc_attr($onfocus), esc_attr($onblur));
    }
    return apply_filters('genesis_search_form', $form, $search_text, $button_text, $label);
}
Ejemplo n.º 22
0
function lpop_ma_archive_loop()
{
    //* Use old loop hook structure if not supporting HTML5
    if (!genesis_html5()) {
        genesis_legacy_loop();
        return;
    }
    do_action('genesis_before_entry');
    printf('<article %s>', genesis_attr('entry'));
    do_action('genesis_entry_header');
    do_action('genesis_before_entry_content');
    printf('<div %s>', genesis_attr('entry-content'));
    lpop_miniaudit_reports();
    // Make this part of an entry content
    echo '</div>';
    //* end .entry-content
    do_action('genesis_after_entry_content');
    do_action('genesis_entry_footer');
    echo '</article>';
    do_action('genesis_after_entry');
}
Ejemplo n.º 23
0
/**
 * Display Breadcrumbs above the Loop. Concedes priority to popular breadcrumb
 * plugins.
 *
 * @since 0.1.6
 *
 * @return null Null if a popular breadcrumb plugin is active.
 */
function genesis_do_breadcrumbs()
{
    if ('posts' === get_option('show_on_front') && is_home() && !genesis_get_option('breadcrumb_home') || 'page' === get_option('show_on_front') && is_front_page() && !genesis_get_option('breadcrumb_front_page') || 'page' === get_option('show_on_front') && is_home() && !genesis_get_option('breadcrumb_posts_page') || is_single() && !genesis_get_option('breadcrumb_single') || is_page() && !genesis_get_option('breadcrumb_page') || (is_archive() || is_search()) && !genesis_get_option('breadcrumb_archive') || is_404() && !genesis_get_option('breadcrumb_404') || is_attachment() && !genesis_get_option('breadcrumb_attachment')) {
        return;
    }
    $breadcrumb_markup_open = sprintf('<div %s>', genesis_attr('breadcrumb'));
    if (function_exists('bcn_display')) {
        echo $breadcrumb_markup_open;
        bcn_display();
        echo '</div>';
    } elseif (function_exists('breadcrumbs')) {
        breadcrumbs();
    } elseif (function_exists('crumbs')) {
        crumbs();
    } elseif (class_exists('WPSEO_Breadcrumbs') && genesis_get_option('breadcrumbs-enable', 'wpseo_internallinks')) {
        yoast_breadcrumb($breadcrumb_markup_open, '</div>');
    } elseif (function_exists('yoast_breadcrumb') && !class_exists('WPSEO_Breadcrumbs')) {
        yoast_breadcrumb($breadcrumb_markup_open, '</div>');
    } else {
        genesis_breadcrumb();
    }
}
Ejemplo n.º 24
0
/**
 * Implement a tighter loop for archives
 * 
 * Basically we don't want any content except the featured image
 * 
 * BUT 
 * one day we might look at {@link https://github.com/desandro/masonry}
 * 
 */
function genesis_oik_do_loop()
{
    if (have_posts()) {
        while (have_posts()) {
            the_post();
            //do_action( 'genesis_before_entry' );
            printf('<article %s>', genesis_attr('entry'));
            //do_action( 'genesis_before_entry_content' );
            //printf( '<div %s>', genesis_attr( 'entry-content' ) );
            do_action('genesis_entry_header');
            do_action('genesis_entry_content');
            //echo '</div>';
            //do_action( 'genesis_after_entry_content' );
            //do_action( 'genesis_entry_footer' );
            echo '</article>';
            //do_action( 'genesis_after_entry' );
        }
        do_action('genesis_after_endwhile');
    } else {
        do_action('genesis_loop_else');
    }
}
Ejemplo n.º 25
0
function bsg_nav_navbar_markup($nav_output, $nav, $args)
{
    $args['depth'] = 3;
    $args['menu_class'] = 'nav navbar-nav';
    $args['fallback_cb'] = 'wp_bootstrap_navwalker::fallback';
    $args['walker'] = new wp_bootstrap_navwalker();
    $nav = wp_nav_menu($args);
    $sanitized_location = sanitize_key($args['theme_location']);
    $data_target = 'nav-collapse-' . $sanitized_location;
    $nav_markup = <<<EOT
    <div class="navbar-header">
      <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#{$data_target}">
        <span class="sr-only">Toggle navigation</span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </button>
EOT;
    $nav_markup .= apply_filters("bsg_nav_navbar_brand_{$sanitized_location}", $navbar_brand);
    $nav_markup .= '</div>';
    // .navbar-header
    $nav_markup .= '<div class="collapse navbar-collapse" id="' . $data_target . '">';
    ob_start();
    do_action('bsg_nav_before_' . $sanitized_location);
    $before_nav = ob_get_clean();
    ob_start();
    do_action('bsg_nav_before_' . $sanitized_location);
    $after_nav = ob_get_clean();
    $nav_markup .= $before_nav . $nav . $after_nav;
    $nav_markup .= '</div>';
    // .collapse .navbar-collapse
    $nav_markup_open = sprintf('<nav %s>', genesis_attr('nav-' . $sanitized_location));
    $nav_markup_open .= genesis_structural_wrap('menu-' . $sanitized_location, 'open', 0);
    $nav_markup_close = genesis_structural_wrap('menu-' . $sanitized_location, 'close', 0) . '</nav>';
    $nav_output = $nav_markup_open . $nav_markup . $nav_markup_close;
    return $nav_output;
}
Ejemplo n.º 26
0
/**
 * Output the markup for the primary menu toggle button.
 *
 * @since  0.1.0
 * @access public
 * @return void
 */
function foxtrot_menu_toggle()
{
    if (has_nav_menu('primary') || has_nav_menu('secondary')) {
        printf('<button %s>%s</button>', genesis_attr('menu-toggle'), esc_html(apply_filters('foxtrot_menu_toggle_text', '')));
    }
}
Ejemplo n.º 27
0
function rainmaker_footer_menu()
{
    printf('<nav %s>', genesis_attr('nav-footer'));
    wp_nav_menu(array('theme_location' => 'footer', 'container' => false, 'depth' => 1, 'fallback_cb' => false, 'menu_class' => 'genesis-nav-menu'));
    echo '</nav>';
}
Ejemplo n.º 28
0
Archivo: post.php Proyecto: nkeat12/dv
/**
 * Echo the the author box and its contents.
 *
 * The title is filterable via `genesis_author_box_title`, and the gravatar size is filterable via
 * `genesis_author_box_gravatar_size`.
 *
 * The final output is filterable via `genesis_author_box`, which passes many variables through.
 *
 * @since 1.3.0
 *
 * @uses genesis_html5() Check for HTML5 support.
 * @uses genesis_attr()  Contextual attributes.
 *
 * @global WP_User $authordata Author (user) object.
 *
 * @param string $context Optional. Allows different author box markup for different contexts, specifically 'single'.
 *                        Default is empty string.
 * @param bool   $echo    Optional. If true, the author box will echo. If false, it will be returned.
 *
 * @return string HTML for author box.
 */
function genesis_author_box($context = '', $echo = true)
{
    global $authordata;
    $authordata = is_object($authordata) ? $authordata : get_userdata(get_query_var('author'));
    $gravatar_size = apply_filters('genesis_author_box_gravatar_size', 70, $context);
    $gravatar = get_avatar(get_the_author_meta('email'), $gravatar_size);
    $description = wpautop(get_the_author_meta('description'));
    //* The author box markup, contextual
    if (genesis_html5()) {
        $title = __('About', 'genesis') . ' <span itemprop="name">' . get_the_author() . '</span>';
        /**
         * Author box title filter.
         *
         * Allows you to filter the title of the author box. $context passed as second parameter to allow for contextual filtering.
         *
         * @since unknown
         *
         * @param string $title Assembled Title.
         * @param string $context Context.
         */
        $title = apply_filters('genesis_author_box_title', $title, $context);
        if ('single' === $context && !genesis_get_seo_option('semantic_headings')) {
            $heading_element = 'h4';
        } elseif (genesis_a11y('headings') || get_the_author_meta('headline', (int) get_query_var('author'))) {
            $heading_element = 'h4';
        } else {
            $heading_element = 'h1';
        }
        $pattern = sprintf('<section %s>', genesis_attr('author-box'));
        $pattern .= '%s<' . $heading_element . ' class="author-box-title">%s</' . $heading_element . '>';
        $pattern .= '<div class="author-box-content" itemprop="description">%s</div>';
        $pattern .= '</section>';
    } else {
        $title = apply_filters('genesis_author_box_title', sprintf('<strong>%s %s</strong>', __('About', 'genesis'), get_the_author()), $context);
        if ('single' === $context || get_the_author_meta('headline', (int) get_query_var('author'))) {
            $pattern = '<div class="author-box"><div>%s %s<br />%s</div></div>';
        } else {
            $pattern = '<div class="author-box">%s<h1>%s</h1><div>%s</div></div>';
        }
    }
    $output = sprintf($pattern, $gravatar, $title, $description);
    /**
     * Author box output filter.
     *
     * Allows you to filter the full output of the author box.
     *
     * @since unknown
     *
     * @param string $output Assembled output.
     * @param string $context Context.
     * @param string $pattern (s)printf pattern.
     * @param string $context Gravatar.
     * @param string $context Title.
     * @param string $context Description.
     */
    $output = apply_filters('genesis_author_box', $output, $context, $pattern, $gravatar, $title, $description);
    if ($echo) {
        echo $output;
    } else {
        return $output;
    }
}
Ejemplo n.º 29
0
 /**
  * Return anchor link for a single crumb.
  *
  * @since 1.5.0
  *
  * @param string $url     URL for href attribute.
  * @param string $title   Title attribute.
  * @param string $content Linked content.
  * @param string $sep     Separator.
  *
  * @return string HTML markup for anchor link and optional separator.
  */
 protected function get_breadcrumb_link($url, $title, $content, $sep = false)
 {
     //* Empty title, for backward compatibility
     $title = '';
     $itemprop_url = genesis_html5() ? ' itemprop="url"' : '';
     $itemprop_name = genesis_html5() ? ' itemprop="name"' : '';
     $link = sprintf('<a href="%s"%s><span%s>%s</span></a>', esc_attr($url), $itemprop_url, $itemprop_name, $content);
     /**
      * Filter the anchor link for a single breadcrumb.
      *
      * @since 1.5.0
      *
      * @param string $link    HTML markup for anchor link, before optional separator is added.
      * @param string $url     URL for href attribute.
      * @param string $title   Title attribute.
      * @param string $content Link content.
      * @param array  $args    Arguments used to generate the breadcrumbs. Documented in Genesis_Breadcrumbs::get_output().
      */
     $link = apply_filters('genesis_breadcrumb_link', $link, $url, $title, $content, $this->args);
     if (genesis_html5()) {
         $link = sprintf('<span %s>', genesis_attr('breadcrumb-link-wrap')) . $link . '</span>';
     }
     if ($sep) {
         $link .= $sep;
     }
     return $link;
 }
Ejemplo n.º 30
0
function wpbilbao_template_videos_do_loop()
{
    global $post;
    /*
     * We select the custom post type 'videos'
     * Videos per page: 9
     */
    $args = wp_parse_args(genesis_get_custom_field('query_args'), array('post_type' => 'videos', 'posts_per_page' => 9, 'post_status' => 'publish'));
    global $wp_query;
    $wp_query = new WP_Query($args);
    if (have_posts()) {
        ?>

      <div class="row">

      <?php 
        do_action('genesis_before_while');
        ?>
      <?php 
        while (have_posts()) {
            the_post();
            ?>

        <?php 
            do_action('genesis_before_entry');
            ?>

        <div class="col-xs-12 col-sm-6 col-md-4">

          <?php 
            printf('<article %s>', genesis_attr('entry'));
            ?>

            <?php 
            do_action('genesis_before_entry_content');
            ?>

            <?php 
            printf('<div %s>', genesis_attr('entry-content'));
            ?>

              <div class="embed-container">
                <?php 
            echo the_field('videos_url_video');
            ?>
              </div><!-- .embed-container-->

              <p class="text-center">
                <a href="<?php 
            echo get_the_permalink();
            ?>
" title="<?php 
            echo get_the_title();
            ?>
">
                  <?php 
            echo the_title();
            ?>
                </a>
              </p>

            </div><!-- .entry-content -->

            <?php 
            do_action('genesis_after_entry_content');
            ?>

          </article>
        </div><!-- .col-md-4 -->

        <?php 
            do_action('genesis_after_entry');
            ?>

      <?php 
        }
        // End of one post.
        ?>
      <?php 
        do_action('genesis_after_endwhile');
        ?>

      </div><!-- .row -->

  <?php 
    } else {
        // If no posts exist.
        ?>
      <?php 
        do_action('genesis_loop_else');
        ?>
  <?php 
    }
    // End of the loop.
    ?>

  <?php 
    wp_reset_query();
}