/** * This function outputs a 404 "Not Found" error message. * * @since 1.6 */ function genesis_404() { genesis_markup(array('open' => '<article class="entry">', 'context' => 'entry-404')); printf('<h1 class="entry-title">%s</h1>', apply_filters('genesis_404_entry_title', __('Not found, error 404', 'genesis'))); echo '<div class="entry-content">'; if (genesis_html5()) { echo apply_filters('genesis_404_entry_content', '<p>' . sprintf(__('The page you are looking for no longer exists. Perhaps you can return back to the site\'s <a href="%s">homepage</a> and see if you can find what you are looking for. Or, you can try finding it by using the search form below.', 'genesis'), trailingslashit(home_url())) . '</p>'); get_search_form(); } else { ?> <p><?php printf(__('The page you are looking for no longer exists. Perhaps you can return back to the site\'s <a href="%s">homepage</a> and see if you can find what you are looking for. Or, you can try finding it with the information below.', 'genesis'), trailingslashit(home_url())); ?> </p> <?php } if (genesis_a11y('404-page')) { echo '<h2>' . __('Sitemap', 'genesis') . '</h2>'; genesis_sitemap('h3'); } else { genesis_sitemap('h4'); } echo '</div>'; genesis_markup(array('close' => '</article>', 'context' => 'entry-404')); }
/** * Pulled from genesis/lib/structure/footer.php with one minor change to always display footer widgets. * * 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 uci_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]; // Commented out to always display widget areas, even if footer-1 is empty. //* 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(); $inside .= sprintf('<div class="footer-widgets-%d widget-area">%s</div>', $counter, $widgets); $counter++; } if ($inside) { $output .= genesis_markup(array('html5' => '<div %s>', 'xhtml' => '<div id="footer-widgets" class="footer-widgets">', 'context' => 'footer-widgets')); $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); }
function scwd_home_feature() { global $post, $SCWD_CUSTOM; genesis_markup(array('html5' => '<article id="home-feature" %s>', 'xhtml' => '<div id="home-feature">', 'context' => 'home-feature')); if (($home_slides = $SCWD_CUSTOM->acf_get_field('_scwd_slides')) !== false) { $i = 0; print '<div class="home-slides">'; foreach ($home_slides as $value) { $att_data = ''; if ($i === 0) { $attr_data = ' style="background-image:url(\'' . $value['sizes']['large'] . '\');"'; } else { $attr_data = ' data-imgurl="' . $value['sizes']['large'] . '"'; } print '<div class="slide"' . $attr_data . '></div>'; $i++; } print '</div>'; } print '<div class="wrap"><div class="inner">'; print '<div class="left"></div><div class="right"><div class="pad">'; //print the_title('<h1>','</h1>'); print the_content(); print '</div></div>'; print '</div></div>'; genesis_markup(array('html5' => '</article>', 'xhtml' => '</div>')); }
function mb_do_header() { global $wp_registered_sidebars; genesis_markup(array('html5' => '<div %s>', 'xhtml' => '<div class="title-area" id="title-area">', 'context' => 'title-area')); if (get_theme_mod('logo', false)) { echo '<h1 class="site-title" itemprop="headline">'; echo '<a href="' . get_bloginfo('url') . '" class="logo" title="' . get_bloginfo('name') . '">'; echo '<img src="' . get_theme_mod('logo') . '" width="' . $width . '" height="' . $height . '" alt="' . get_bloginfo('name') . '"/>'; echo '</a>'; echo '</h1>'; } else { do_action('genesis_site_title'); do_action('genesis_site_description'); } echo '</div>'; if (isset($wp_registered_sidebars['header-right']) && is_active_sidebar('header-right') || has_action('genesis_header_right')) { genesis_markup(array('html5' => '<aside %s>', 'xhtml' => '<div class="widget-area header-widget-area">', 'context' => 'header-widget-area')); do_action('genesis_header_right'); add_filter('wp_nav_menu_args', 'genesis_header_menu_args'); add_filter('wp_nav_menu', 'genesis_header_menu_wrap'); dynamic_sidebar('header-right'); remove_filter('wp_nav_menu_args', 'genesis_header_menu_args'); remove_filter('wp_nav_menu', 'genesis_header_menu_wrap'); genesis_markup(array('html5' => '</aside>', 'xhtml' => '</div>')); } }
/** * 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 gmdl_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]; $footer_widget_large_class = 12 / $footer_widgets; //* 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(); $inside .= sprintf('<div class="mdl-cell mdl-cell--4-col-tablet mdl-cell-%d-col footer-widgets-%d widget-area">%s</div>', $footer_widget_large_class, $counter, $widgets); $counter++; } if ($inside) { $output .= genesis_markup(array('html5' => '<div %s>', 'xhtml' => '<div id="footer-widgets" class="footer-widgets mdl-mega-footer">', 'context' => 'footer-widgets')); $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); }
/** * Echo the widget content. * * @since 0.1.8 * * @global WP_Query $wp_query Query object. * @global integer $more * * @param array $args Display arguments including before_title, after_title, before_widget, and after_widget. * @param array $instance The settings for the particular instance of the widget */ function widget($args, $instance) { //* Merge with defaults $instance = wp_parse_args((array) $instance, $this->defaults); if (!empty($instance['url'])) { $instance['url'] = do_shortcode($instance['url']); } if (!empty($instance['image_url'])) { $instance['image_url'] = do_shortcode($instance['image_url']); } if (!empty($instance['description'])) { $instance['description'] = do_shortcode($instance['description']); } echo $args['before_widget']; if (!empty($instance['title'])) { echo $args['before_title'] . apply_filters('widget_title', $instance['title'], $instance, $this->id_base) . $args['after_title']; } genesis_markup(array('html5' => '<article %s>', 'xhtml' => sprintf('<div class="%s">', implode(' ', get_post_class())), 'context' => 'entry')); if (!empty($instance['url'])) { echo '<a href="' . $instance['url'] . '" title="' . $instance['title'] . '" class="' . esc_attr($instance['image_alignment']) . '">' . '<img src="' . $instance['image_url'] . '" class="entry-image" itemprop="image" />' . '</a>'; } if (!empty($instance['description'])) { echo genesis_html5() ? '<div class="entry-content">' : ''; echo esc_html($instance['description']); echo genesis_html5() ? '</div>' : ''; } genesis_markup(array('html5' => '</article>', 'xhtml' => '</div>')); echo $args['after_widget']; }
/** * Echo archive pagination in page numbers format. * * Applies the `genesis_prev_link_text` and `genesis_next_link_text` filters. * * The links, if needed, are ordered as: * * * previous page arrow, * * first page, * * up to two pages before current page, * * current page, * * up to two pages after the current page, * * last page, * * next page arrow. * * @since 0.2.3 * * @global WP_Query $wp_query Query object. * * @return null Return early if on a single post or page, or only one page present. */ function gmdl_numeric_posts_nav() { if (is_singular()) { return; } global $wp_query; //* Stop execution if there's only 1 page if ($wp_query->max_num_pages <= 1) { return; } $paged = get_query_var('paged') ? absint(get_query_var('paged')) : 1; $max = intval($wp_query->max_num_pages); //* Add current page to the array if ($paged >= 1) { $links[] = $paged; } //* Add the pages around the current page to the array if ($paged >= 3) { $links[] = $paged - 1; $links[] = $paged - 2; } if ($paged + 2 <= $max) { $links[] = $paged + 2; $links[] = $paged + 1; } genesis_markup(array('html5' => '<div %s>', 'xhtml' => '<div class="navigation">', 'context' => 'archive-pagination')); echo '<ul class="mdl-cell mdl-cell--12-col pagination">'; //* Previous Post Link if (get_previous_posts_link()) { printf('<li class="pagination-previous alignleft">%s</li>' . "\n", get_previous_posts_link(apply_filters('genesis_prev_link_text', '<span class="mdl-button mdl-js-button mdl-js-ripple-effect mdl-button--icon mdl-color--accent mdl-color-text--white" role="presentation" data-upgraded=",MaterialButton,MaterialRipple"><i class="material-icons">arrow_back</i><span class="mdl-button__ripple-container"><span class="mdl-ripple"></span></span></span>' . __('Previous Page', 'genesis')))); } //* Link to first page, plus ellipses if necessary if (!in_array(1, $links)) { $class = 1 == $paged ? ' class="current"' : ''; printf('<li%s><a href="%s">%s</a></li>' . "\n", $class, esc_url(get_pagenum_link(1)), '1'); if (!in_array(2, $links)) { echo '<li class="pagination-omission">…</li>'; } } //* Link to current page, plus 2 pages in either direction if necessary sort($links); foreach ((array) $links as $link) { $class = $paged == $link ? ' class="current"' : ''; printf('<li%s><a href="%s">%s</a></li>' . "\n", $class, esc_url(get_pagenum_link($link)), $link); } //* Link to last page, plus ellipses if necessary if (!in_array($max, $links)) { if (!in_array($max - 1, $links)) { echo '<li class="pagination-omission">…</li>' . "\n"; } $class = $paged == $max ? ' class="current"' : ''; printf('<li%s><a href="%s">%s</a></li>' . "\n", $class, esc_url(get_pagenum_link($max)), $max); } //* Next Post Link if (get_next_posts_link()) { printf('<li class="pagination-next alignright">%s</li>' . "\n", get_next_posts_link(apply_filters('genesis_next_link_text', __('Next Page', 'genesis') . '<span class="mdl-button mdl-js-button mdl-js-ripple-effect mdl-button--icon mdl-color--accent mdl-color-text--white" role="presentation" data-upgraded=",MaterialButton,MaterialRipple"><i class="material-icons">arrow_forward</i><span class="mdl-button__ripple-container"><span class="mdl-ripple"></span></span></span>'))); } echo '</ul></div>' . "\n"; }
/** * Echo archive pagination in page numbers format. * * Applies the `genesis_prev_link_text` and `genesis_next_link_text` filters. * * The links, if needed, are ordered as: * * * previous page arrow, * * first page, * * up to two pages before current page, * * current page, * * up to two pages after the current page, * * last page, * * next page arrow. * * @since 0.2.3 * * @global WP_Query $wp_query Query object. * * @return null Return early if on a single post or page, or only one page present. */ function ygf_numeric_posts_nav() { if (is_singular()) { return; } global $wp_query; //* Stop execution if there's only 1 page if ($wp_query->max_num_pages <= 1) { return; } $paged = get_query_var('paged') ? absint(get_query_var('paged')) : 1; $max = intval($wp_query->max_num_pages); //* Add current page to the array if ($paged >= 1) { $links[] = $paged; } //* Add the pages around the current page to the array if ($paged >= 3) { $links[] = $paged - 1; $links[] = $paged - 2; } if ($paged + 2 <= $max) { $links[] = $paged + 2; $links[] = $paged + 1; } genesis_markup(array('html5' => '<div %s>', 'xhtml' => '<div class="navigation">', 'context' => 'archive-pagination')); echo '<ul class="pagination">'; //* Previous Post Link if (get_previous_posts_link()) { printf('<li class="pagination-previous">%s</li>' . "\n", get_previous_posts_link(apply_filters('genesis_prev_link_text', '«' . __('Previous Page', 'genesis')))); } //* Link to first page, plus ellipses if necessary if (!in_array(1, $links)) { $class = 1 == $paged ? ' class="active current"' : ''; printf('<li%s><a href="%s">%s</a></li>' . "\n", $class, esc_url(get_pagenum_link(1)), '1'); if (!in_array(2, $links)) { echo '<li class="pagination-omission">…</li>'; } } //* Link to current page, plus 2 pages in either direction if necessary sort($links); foreach ((array) $links as $link) { $class = $paged == $link ? ' class="active current"' : ''; printf('<li%s><a href="%s">%s</a></li>' . "\n", $class, esc_url(get_pagenum_link($link)), $link); } //* Link to last page, plus ellipses if necessary if (!in_array($max, $links)) { if (!in_array($max - 1, $links)) { echo '<li class="pagination-omission">…</li>' . "\n"; } $class = $paged == $max ? ' class="active current"' : ''; printf('<li%s><a href="%s">%s</a></li>' . "\n", $class, esc_url(get_pagenum_link($max)), $max); } //* Next Post Link if (get_next_posts_link()) { printf('<li class="pagination-next">%s</li>' . "\n", get_next_posts_link(apply_filters('genesis_next_link_text', __('Next Page', 'genesis') . '»'))); } echo '</ul></div>' . "\n"; }
function bfg_do_home_featured() { genesis_markup(array('html5' => '<div %s>', 'xhtml' => '<div class="home-featured">', 'context' => 'home-featured')); genesis_structural_wrap('home-featured'); genesis_widget_area('home-featured', array('before' => '', 'after' => '')); genesis_structural_wrap('home-featured', 'close'); echo '</div>'; }
/** * Add closing wrapper after WooCommerce loop. */ public function theme_wrapper_end() { do_action('genesis_after_loop'); genesis_markup(array('html5' => '</main>', 'xhtml' => '</div>')); do_action('genesis_after_content'); echo '</div>'; //* end .content-sidebar-wrap or #content-sidebar-wrap do_action('genesis_after_content_sidebar_wrap'); }
/** * Echo the widget content. * * @since 0.1.8 * * @param array $args Display arguments including before_title, after_title, before_widget, and after_widget. * @param array $instance The settings for the particular instance of the widget */ function widget($args, $instance) { global $wp_query; extract($args); //* Merge with defaults $instance = wp_parse_args((array) $instance, $this->defaults); echo $before_widget; //* Set up the author bio if (!empty($instance['title'])) { echo $before_title . apply_filters('widget_title', $instance['title'], $instance, $this->id_base) . $after_title; } $wp_query = new WP_Query(array('page_id' => $instance['page_id'])); if (have_posts()) { while (have_posts()) { the_post(); genesis_markup(array('html5' => '<article %s>', 'xhtml' => sprintf('<div class="%s">', implode(' ', get_post_class())), 'context' => 'entry')); $image = genesis_get_image(array('format' => 'html', 'size' => $instance['image_size'], 'context' => 'featured-page-widget', 'attr' => genesis_parse_attr('entry-image-widget'))); if ($instance['show_image'] && $image) { printf('<a href="%s" title="%s" class="%s">%s</a>', get_permalink(), the_title_attribute('echo=0'), esc_attr($instance['image_alignment']), $image); } if (!empty($instance['show_title'])) { if (genesis_html5()) { printf('<header class="entry-header"><h2 class="entry-title"><a href="%s" title="%s">%s</a></h2></header>', get_permalink(), the_title_attribute('echo=0'), get_the_title()); } else { printf('<h2><a href="%s" title="%s">%s</a></h2>', get_permalink(), the_title_attribute('echo=0'), get_the_title()); } } if (!empty($instance['show_content'])) { echo genesis_html5() ? '<div class="entry-content">' : ''; if (empty($instance['content_limit'])) { global $more; $more = 0; the_content($instance['more_text']); } else { the_content_limit((int) $instance['content_limit'], esc_html($instance['more_text'])); } echo genesis_html5() ? '</div>' : ''; } if (!empty($instance['custom_text'])) { $text = wp_kses_post($instance['custom_text']); echo '<div class="custom-text">'; echo $instance['filter'] ? wpautop($text) : $text; if (!empty($instance['more_text'])) { echo '<span class="more-link"><a href="' . get_permalink($instance['page_id']) . '">' . $instance['more_text'] . '</a></span>'; } echo '</div>'; } genesis_markup(array('html5' => '</article>', 'xhtml' => '</div>')); } } //* Restore original query wp_reset_query(); echo $after_widget; }
function menu_in_footer() { $class = 'menu-footer'; $args = array('menu' => 'Footer', 'container' => '', 'menu_class' => $class, 'echo' => 0, 'depth' => 1); $nav = wp_nav_menu($args); $nav_markup_open = genesis_markup(array('html5' => '<nav %s>', 'xhtml' => '<div id="nav">', 'context' => 'nav-footer', 'echo' => false)); $nav_markup_open .= genesis_structural_wrap('menu-footer', 'open', 0); $nav_markup_close = genesis_structural_wrap('menu-footer', 'close', 0); $nav_markup_close .= genesis_html5() ? '</nav>' : '</div>'; $nav_output = $nav_markup_open . $nav . $nav_markup_close; echo $nav_output; }
function signature_add_demo_nav() { /** If menu is assigned to theme location, output */ $menu_obj = wp_get_nav_menu_object('Demo'); if (!empty($menu_obj)) { $args = array('menu' => 'Demo', 'container' => '', 'menu_class' => 'menu demo-menu', 'echo' => 0); $nav = wp_nav_menu($args); $pattern = genesis_markup('<nav class="demo">%2$s%1$s%3$s</nav>', '<div id="nav-demo">%2$s%1$s%3$s</div>', 0); $nav_output = sprintf($pattern, $nav, genesis_structural_wrap('nav', 'open', 0), genesis_structural_wrap('nav', 'close', 0)); echo apply_filters('genesis_do_nav', $nav_output, $nav, $args); } }
/** * Display the sidebar for the given post type * * Normally we just append -widget-area but for some post types we override it * * Post type | Sidebar used * ---------- | ------------- * oik_premiumversion | oik_pluginversion-widget-area * oik_sc_param | sidebar-alt * * */ function genesis_hm_get_sidebar() { //* Output primary sidebar structure genesis_markup(array('html5' => '<aside %s>', 'xhtml' => '<div id="sidebar" class="sidebar widget-area">', 'context' => 'sidebar-primary')); do_action('genesis_before_sidebar_widget_area'); $post_type = get_post_type(); $cpts = array("oik_premiumversion" => "oik_pluginversion-widget-area", "oik_sc_param" => "sidebar-alt", "attachment" => "sidebar-alt"); $dynamic_sidebar = bw_array_get($cpts, $post_type, "{$post_type}-widget-area"); dynamic_sidebar($dynamic_sidebar); do_action('genesis_after_sidebar_widget_area'); genesis_markup(array('html5' => '</aside>', 'xhtml' => '</div>')); }
function bfg_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; } switch ($footer_widgets) { case '1': default: $class = 'col-sm-12'; break; case '2': $class = 'col-sm-6'; break; case '3': $class = 'col-sm-4'; break; case '4': $class = 'col-sm-3'; break; case '6': $class = 'col-sm-2'; break; case '12': $class = 'col-sm-1'; break; } $inside = ''; $output = ''; $counter = 1; while ($counter <= $footer_widgets) { //* Darn you, WordPress! Gotta output buffer. ob_start(); dynamic_sidebar('footer-' . $counter); $widgets = ob_get_clean(); $inside .= sprintf('<div class="footer-widgets-%d %s widget-area">%s</div>', $counter, $class, $widgets); $counter++; } if ($inside) { $output .= genesis_markup(array('html5' => '<div %s>', 'xhtml' => '<div id="footer-widgets" class="footer-widgets">', 'context' => 'footer-widgets')); $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); }
/** * 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. * * Makes Genesis Structural Wrap optional for better Bootstrap 3 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 gb_genesis_get_nav_menu($args = array(), $structural_wrap = false) { $args = wp_parse_args($args, array('theme_location' => '', 'container' => '', 'menu_class' => 'menu genesis-nav-menu', '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_close = ''; if ($structural_wrap) { $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); }
function ygf_prev_next_post_nav() { if (!is_singular('post')) { return; } genesis_markup(array('html5' => '<ul %s>', 'xhtml' => '<ul class="pagination navigation">', 'context' => 'adjacent-entry-pagination')); echo '<li class="arrow pagination-previous alignleft">'; previous_post_link('%link', '« %title'); echo '</li>'; echo '<li class="arrow pagination-next alignright">'; next_post_link('%link', '%title »'); echo '</li>'; echo '</ul>'; }
function bsg_genesis_prev_next_posts_nav() { $prev_link = get_previous_posts_link(apply_filters('genesis_prev_link_text', '<span aria-hidden="true">←</span> ' . __('Previous Page', 'genesis'))); $next_link = get_next_posts_link(apply_filters('genesis_next_link_text', __('Next Page', 'genesis') . ' <span aria-hidden="true">→</span>')); $prev = $prev_link ? '<li class="previous">' . $prev_link . '</li>' : ''; $next = $next_link ? '<li class="next">' . $next_link . '</li>' : ''; $nav = genesis_markup(array('html5' => '<nav %s><ul class="pager">', 'xhtml' => '<div class="navigation"><ul class="pager">', 'context' => 'archive-pagination', 'echo' => false)); $nav .= $prev; $nav .= $next; $nav .= genesis_html5() ? '</ul></nav>' : '</ul></div>'; if ($prev || $next) { echo $nav; } }
/** * Echo the widget content. * * @since 0.2.0 * * @param array $args Display arguments including before_title, after_title, before_widget, and after_widget. * @param array $instance The settings for the particular instance of the widget */ function widget($args, $instance) { global $wp_query; extract($args); //* Merge with defaults $instance = wp_parse_args((array) $instance, $this->defaults); echo $before_widget; //* Set up the widget title if (!empty($instance['title'])) { echo '<h2 class="widget-title widgettitle">' . apply_filters('widget_title', $instance['title'], $instance, $this->id_base) . '</h2>'; } $query_args = array('post_type' => 'awp-community', 'showposts' => $instance['posts_num'], 'offset' => $instance['posts_offset'], 'orderby' => $instance['orderby'], 'order' => $instance['order']); $wp_query = new WP_Query($query_args); if (have_posts()) { while (have_posts()) { the_post(); genesis_markup(array('html5' => '<article %s>', 'xhtml' => sprintf('<div class="%s">', implode(' ', get_post_class())), 'context' => 'entry')); $image = genesis_get_image(array('format' => 'html', 'size' => $instance['image_size'], 'context' => 'featured-community-widget', 'attr' => genesis_parse_attr('entry-image-widget'))); if ($instance['show_image'] && $image) { printf('<div class="awp-community-image"><a href="%s" title="%s" class="%s">%s</a></div>', get_permalink(), the_title_attribute('echo=0'), 'awp-community-link', $image); } if ($instance['show_title']) { echo '<header class="entry-header">'; printf('<h3 class="entry-title"><a href="%s" title="%s">%s</a></h3>', get_permalink(), the_title_attribute('echo=0'), get_the_title()); echo '</header>'; } if (!empty($instance['show_content'])) { echo '<div class="entry-content">'; if ('excerpt' == $instance['show_content']) { $current_excerpt = get_the_excerpt(); echo $current_excerpt; //the_excerpt(); } elseif ('content-limit' == $instance['show_content']) { the_content_limit((int) $instance['content_limit'], esc_html($instance['more_text'])); } else { global $more; $orig_more = $more; $more = 0; the_content(esc_html($instance['more_text'])); $more = $orig_more; } echo '</div>'; } genesis_markup(array('html5' => '</article>', 'xhtml' => '</div>')); } } //* Restore original query wp_reset_query(); echo $after_widget; }
function uci_genesis_post_title() { $title = apply_filters('genesis_post_title_text', get_the_title()); if (0 === mb_strlen($title)) { return; } //* Link it, if necessary if (!is_singular() && apply_filters('genesis_link_post_title', true)) { $title = sprintf('<a href="%s" rel="bookmark">%s</a>', get_permalink(), $title); } $wrap = 'h2'; //* Build the output $output = genesis_markup(array('html5' => "<{$wrap} %s>", 'xhtml' => sprintf('<%s class="entry-title">%s</%s>', $wrap, $title, $wrap), 'context' => 'entry-title', 'echo' => false)); $output .= genesis_html5() ? "{$title}</{$wrap}>" : ''; echo apply_filters('genesis_post_title_output', "{$output} \n"); }
function gmdl_prev_next_post_nav() { if (!is_singular('post')) { return; } echo '<div class="mdl-card__actions mdl-card--border mdl-grid">'; genesis_markup(array('html5' => '<ul %s>', 'xhtml' => '<ul class="pagination navigation mdl-cell mdl-cell--12-col">', 'context' => 'adjacent-entry-pagination')); echo '<li class="arrow pagination-previous alignleft">'; previous_post_link('%link', '<span class="mdl-button mdl-js-button mdl-js-ripple-effect mdl-button--icon mdl-color--accent mdl-color-text--white" role="presentation" data-upgraded=",MaterialButton,MaterialRipple"><i class="material-icons">keyboard_arrow_left</i><span class="mdl-button__ripple-container"><span class="mdl-ripple"></span></span></span> %title'); echo '</li>'; echo '<li class="section-spacer"></li>'; echo '<li class="arrow pagination-next alignright">'; next_post_link('%link', '%title <span class="mdl-button mdl-js-button mdl-js-ripple-effect mdl-button--icon mdl-color--accent mdl-color-text--white" role="presentation" data-upgraded=",MaterialButton,MaterialRipple"><i class="material-icons">keyboard_arrow_right</i><span class="mdl-button__ripple-container"><span class="mdl-ripple"></span></span></span>'); echo '</li>'; echo '</ul></div>'; }
/** * Used to initialize the framework in the various template files. * * It pulls in all the necessary components like header and footer, the basic * markup structure, and hooks. * * @since 1.3.0 */ function genesis() { get_header(); do_action('genesis_before_content_sidebar_wrap'); genesis_markup(array('open' => '<div %s>', 'context' => 'content-sidebar-wrap')); do_action('genesis_before_content'); genesis_markup(array('open' => '<main %s>', 'context' => 'content')); do_action('genesis_before_loop'); do_action('genesis_loop'); do_action('genesis_after_loop'); genesis_markup(array('close' => '</main>', 'context' => 'content')); do_action('genesis_after_content'); genesis_markup(array('close' => '</div>', 'context' => 'content-sidebar-wrap')); do_action('genesis_after_content_sidebar_wrap'); get_footer(); }
function bfg_do_footer() { if (get_theme_mod('creds', false)) { $creds = get_theme_mod('creds'); } else { $creds = '<a href="http://www.superfastbusiness.com">Bootstrap for Genesis</a> by <a href="http://www.superfastbusiness.com">SuperFastBusiness</a>'; } genesis_markup(array('html5' => '<div %s>', 'xhtml' => '<div class="copyright">', 'context' => 'copyright')); echo apply_filters('bfg_footer_creds', do_shortcode($creds)); echo '</div>'; if (is_active_sidebar('footer-right')) { genesis_markup(array('html5' => '<div %s>', 'xhtml' => '<div class="footer-widget-area">', 'context' => 'footer-widget-area')); genesis_widget_area('footer-right', array('before' => '', 'after' => '')); echo '</div>'; } }
/** * Used to initialize the framework in the various template files. * * It pulls in all the necessary components like header and footer, the basic * markup structure, and hooks. * * @since 1.3.0 */ function genesis() { get_header(); do_action('genesis_before_content_sidebar_wrap'); genesis_markup(array('html5' => '<div %s>', 'xhtml' => '<div id="content-sidebar-wrap">', 'context' => 'content-sidebar-wrap')); do_action('genesis_before_content'); genesis_markup(array('html5' => '<main %s>', 'xhtml' => '<div id="content" class="hfeed">', 'context' => 'content')); do_action('genesis_before_loop'); do_action('genesis_loop'); do_action('genesis_after_loop'); genesis_markup(array('html5' => '</main>', 'xhtml' => '</div>')); do_action('genesis_after_content'); echo '</div>'; //* end .content-sidebar-wrap or #content-sidebar-wrap do_action('genesis_after_content_sidebar_wrap'); get_footer(); }
/** * 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); }
/** * Expedites the widget area registration process by taking common things, before / after_widget, before / after_title, * and doing them automatically. * * See the WP function `register_sidebar()` for the list of supports $args keys. * * A typical usage is: * * ~~~ * genesis_register_widget_area( * array( * 'id' => 'my-sidebar', * 'name' => __( 'My Sidebar', 'my-theme-text-domain' ), * 'description' => __( 'A description of the intended purpose or location', 'my-theme-text-domain' ), * ) * ); * ~~~ * * @since 2.1.0 * * @param string|array $args Name, ID, description and other widget area arguments. * @return string The sidebar ID that was added. */ function genesis_register_widget_area($args) { $defaults = array('before_widget' => genesis_markup(array('open' => '<section id="%%1$s" class="widget %%2$s"><div class="widget-wrap">', 'context' => 'widget-wrap', 'echo' => false)), 'after_widget' => genesis_markup(array('close' => '</div></section>' . "\n", 'context' => 'widget-wrap', 'echo' => false)), 'before_title' => '<h4 class="widget-title widgettitle">', 'after_title' => "</h4>\n"); /** * A filter on the default parameters used by `genesis_register_widget_area()`. For backward compatibility. * * @since 1.0.1 */ $defaults = apply_filters('genesis_register_sidebar_defaults', $defaults, $args); /** * A filter on the default parameters used by `genesis_register_widget_area()`. * * @since 2.1.0 */ $defaults = apply_filters('genesis_register_widget_area_defaults', $defaults, $args); $args = wp_parse_args($args, $defaults); return register_sidebar($args); }
/** * Echo the default header, including the #title-area div, along with #title and #description, as well as the .widget-area. * * Does the `genesis_site_title`, `genesis_site_description` and `genesis_header_right` actions. * * @since 1.0.2 * * @global $wp_registered_sidebars Holds all of the registered sidebars. * * @uses genesis_markup() Apply contextual markup. */ function ygf_do_header() { global $wp_registered_sidebars; genesis_markup(array('html5' => '<ul %s>', 'xhtml' => '<div id="title-area">', 'context' => 'title-area')); do_action('genesis_site_title'); do_action('genesis_site_description'); echo '</ul>'; if (isset($wp_registered_sidebars['header-right']) && is_active_sidebar('header-right') || has_action('genesis_header_right')) { genesis_markup(array('html5' => '<aside %s>', 'xhtml' => '<div class="widget-area header-widget-area">', 'context' => 'header-widget-area')); do_action('genesis_header_right'); add_filter('wp_nav_menu_args', 'genesis_header_menu_args'); add_filter('wp_nav_menu', 'genesis_header_menu_wrap'); dynamic_sidebar('header-right'); remove_filter('wp_nav_menu_args', 'genesis_header_menu_args'); remove_filter('wp_nav_menu', 'genesis_header_menu_wrap'); genesis_markup(array('html5' => '</aside>', 'xhtml' => '</div>')); } }
function foundation_do_header() { global $wp_registered_sidebars; genesis_markup(array('html5' => '<div %s>', 'xhtml' => '<div class="top-bar-left">', 'context' => 'top-bar-left')); do_action('genesis_site_title'); do_action('genesis_site_description'); echo '</div>'; if (isset($wp_registered_sidebars['header-right']) && is_active_sidebar('header-right') || has_action('genesis_header_right')) { genesis_markup(array('html5' => '<div %s>' . genesis_sidebar_title('header-right'), 'context' => 'top-bar-right')); do_action('genesis_header_right'); add_filter('wp_nav_menu_args', 'genesis_header_menu_args'); add_filter('wp_nav_menu', 'genesis_header_menu_wrap'); dynamic_sidebar('header-right'); remove_filter('wp_nav_menu_args', 'genesis_header_menu_args'); remove_filter('wp_nav_menu', 'genesis_header_menu_wrap'); echo '</div>'; } }
function cgp_genesis_header() { do_action('genesis_doctype'); do_action('genesis_title'); do_action('genesis_meta'); wp_head(); //* we need this for plugins ?> </head> <?php genesis_markup(array('html5' => '<body %s>', 'xhtml' => sprintf('<body class="%s">', implode(' ', get_body_class())), 'context' => 'body')); do_action('genesis_before'); genesis_markup(array('html5' => '<div %s>', 'xhtml' => '<div id="wrap">', 'context' => 'site-container')); do_action('genesis_before_header'); do_action('genesis_header'); do_action('genesis_after_header'); genesis_markup(array('html5' => '<div %s>', 'xhtml' => '<div id="inner">', 'context' => 'content-wrapper')); genesis_structural_wrap('content-wrapper'); }
/** * Echo the default header, including the #title-area div, along with #title and #description, as well as the .widget-area. * * Does the `genesis_site_title`, `genesis_site_description` and `genesis_header_right` actions. * * @since 1.0.2 * * @global $wp_registered_sidebars Holds all of the registered sidebars. * * @uses genesis_markup() Apply contextual markup. */ function ygf_do_header() { global $wp_registered_sidebars; if (has_nav_menu('mobile-off-canvas')) { echo '<div class="show-for-medium"><nav class="top-bar">'; } else { echo '<nav class="top-bar">'; } genesis_markup(array('html5' => '<ul %s>', 'xhtml' => '<div id="title-area">', 'context' => 'title-area')); do_action('genesis_site_title'); do_action('genesis_site_description'); genesis_markup(array('html5' => '</ul>', 'xhtml' => '</div>')); if (isset($wp_registered_sidebars['header-right']) && is_active_sidebar('header-right') || has_action('genesis_header_right')) { genesis_markup(array('html5' => '<aside %s>', 'xhtml' => '<div class="widget-area header-widget-area">', 'context' => 'header-widget-area')); do_action('genesis_header_right'); add_filter('wp_nav_menu_args', 'genesis_header_menu_args'); add_filter('wp_nav_menu', 'genesis_header_menu_wrap'); dynamic_sidebar('header-right'); //remove_filter( 'wp_nav_menu_args', 'genesis_header_menu_args' ); //remove_filter( 'wp_nav_menu', 'genesis_header_menu_wrap' ); genesis_markup(array('html5' => '</aside>', 'xhtml' => '</div>')); } if (has_nav_menu('mobile-off-canvas')) { echo '</nav></div><div class="show-for-small-only"><nav class="title-bar">'; genesis_markup(array('html5' => '<section class="title-bar-left"><button class="menu-icon" data-toggle="offCanvas"><span></span></button>', 'xhtml' => '<div class="title-bar-left"><button class="menu-icon" data-toggle="offCanvas"><span></span></button>')); // Set what goes inside the wrapping tags $inside = sprintf('%s', 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; $title = genesis_html5() ? sprintf("<{$wrap} %s>", genesis_attr('title-bar-title')) : sprintf('<%s id="title">%s</%s>', $wrap, $inside, $wrap); $title .= genesis_html5() ? "{$inside}</{$wrap}>" : ''; echo apply_filters('genesis_seo_title', $title, $inside, $wrap); genesis_markup(array('html5' => '</section>', 'xhtml' => '</div>')); genesis_markup(array('html5' => '<section class="title-bar-right">', 'xhtml' => '<div class="title-bar-right">')); genesis_markup(array('html5' => '</section>', 'xhtml' => '</div>')); echo '</nav></div>'; } }