function widget($args, $instance)
 {
     extract($args);
     $instance = wp_parse_args((array) $instance, array('title' => '', 'alignment' => 'left', 'user' => '', 'size' => '45', 'author_info' => '', 'bio_text' => '', 'page' => '', 'posts_link' => ''));
     echo $before_widget;
     if (!empty($instance['title'])) {
         echo $before_title . apply_filters('widget_title', $instance['title']) . $after_title;
     }
     $text = '';
     if (!empty($instance['alignment'])) {
         $text .= '<span class="align' . esc_attr($instance['alignment']) . '">';
     }
     $text .= get_avatar($instance['user'], $instance['size']);
     if (!empty($instance['alignment'])) {
         $text .= '</span>';
     }
     if ($instance['author_info'] == 'text') {
         global $_genesis_formatting_allowedtags;
         $text .= wp_kses($instance['bio_text'], $_genesis_formatting_allowedtags);
     } else {
         $text .= get_the_author_meta('description', $instance['user']);
     }
     $text .= $instance['page'] ? sprintf(' <a class="pagelink" href="%s">%s</a>', get_page_link($instance['page']), sprintf(__('[Read More %s]', 'genesis'), g_ent('&hellip;'))) : '';
     $text .= $instance['posts_link'] ? sprintf('<div class="posts_link"><a href="%s">%s</a></div>', get_author_posts_url($instance['user']), __('View My Blog Posts', 'genesis')) : '';
     echo wpautop($text);
     echo $after_widget;
 }
 /**
  * Constructor. Set the default widget options and create widget.
  */
 function __construct()
 {
     $this->defaults = array('title' => '', 'alignment' => 'left', 'user' => '', 'size' => '45', 'author_info' => '', 'bio_text' => '', 'page' => '', 'page_link_text' => sprintf(__('[Read More %s]', 'genesis'), g_ent('&hellip;')), 'posts_link' => '');
     $widget_ops = array('classname' => 'user-profile', 'description' => __('Displays user profile block with Gravatar', 'genesis'));
     $control_ops = array('id_base' => 'user-profile', 'width' => 200, 'height' => 250);
     $this->WP_Widget('user-profile', __('Genesis - User Profile', 'genesis'), $widget_ops, $control_ops);
 }
Exemplo n.º 3
0
/**
 * Adds the link to the child theme
 * 
 * @since Unknown
 *
 * @param array $atts Shortcode attributes
 * @return string
 */
function genesis_footer_childtheme_link_shortcode($atts)
{
    $defaults = array('before' => g_ent('&middot; '), 'after' => '');
    $atts = shortcode_atts($defaults, $atts);
    if (!is_child_theme() || !defined('CHILD_THEME_NAME') || !defined('CHILD_THEME_URL')) {
        return;
    }
    $output = sprintf('%s<a href="%s" title="%s">%s</a>%s', $atts['before'], esc_url(CHILD_THEME_URL), esc_attr(CHILD_THEME_NAME), esc_html(CHILD_THEME_NAME), $atts['after']);
    return apply_filters('genesis_footer_childtheme_link_shortcode', $output, $atts);
}
Exemplo n.º 4
0
 /**
  * Create an admin menu item and settings page.
  *
  * @since 1.8.0
  *
  * @uses GENESIS_SEO_SETTINGS_FIELD settings field key
  *
  * @global string $_genesis_seo_settings_pagehook SEO Settings page hook,
  * kept for backwards compatibility, since this class now uses $this->pagehook.
  */
 function __construct()
 {
     $page_id = 'seo-settings';
     $menu_ops = array('submenu' => array('parent_slug' => 'genesis', 'page_title' => __('Genesis - SEO Settings', 'genesis'), 'menu_title' => __('SEO Settings', 'genesis')));
     $page_ops = array('screen_icon' => 'options-general', 'save_button_text' => __('Save Settings', 'genesis'), 'reset_button_text' => __('Reset Settings', 'genesis'), 'saved_notice_text' => __('Settings saved.', 'genesis'), 'reset_notice_text' => __('Settings reset.', 'genesis'), 'error_notice_text' => __('Error saving settings.', 'genesis'));
     $settings_field = GENESIS_SEO_SETTINGS_FIELD;
     $default_settings = apply_filters('genesis_seo_settings_defaults', array('append_description_home' => 1, 'append_site_title' => 0, 'doctitle_sep' => g_ent('&mdash;'), 'doctitle_seplocation' => 'right', 'home_h1_on' => 'title', 'home_doctitle' => '', 'home_description' => '', 'home_keywords' => '', 'home_noindex' => 0, 'home_nofollow' => 0, 'home_noarchive' => 0, 'home_author' => 0, 'canonical_archives' => 1, 'head_adjacent_posts_rel_link' => 0, 'head_wlwmanifest_link' => 0, 'head_shortlink' => 0, 'noindex_cat_archive' => 1, 'noindex_tag_archive' => 1, 'noindex_author_archive' => 1, 'noindex_date_archive' => 1, 'noindex_search_archive' => 1, 'noarchive_cat_archive' => 0, 'noarchive_tag_archive' => 0, 'noarchive_author_archive' => 0, 'noarchive_date_archive' => 0, 'noarchive_search_archive' => 0, 'noarchive' => 0, 'noodp' => 1, 'noydir' => 1));
     $this->create($page_id, $menu_ops, $page_ops, $settings_field, $default_settings);
     add_action('genesis_settings_sanitizer_init', array($this, 'sanitizer_filters'));
 }
function genesis_do_footer()
{
    // Build the filterable text strings. Includes shortcodes.
    $backtotop_text = apply_filters('genesis_footer_backtotop_text', '[footer_backtotop]');
    $creds_text = apply_filters('genesis_footer_creds_text', sprintf('%s [footer_copyright] [footer_childtheme_link] %s [footer_genesis_link] [footer_studiopress_link] %s [footer_wordpress_link] %s [footer_loginout]', __('Copyright', 'genesis'), g_ent('&middot;'), g_ent('&middot;'), g_ent('&middot;')));
    // For backward compatibility (pre-1.1 filter)
    if (apply_filters('genesis_footer_credits', FALSE)) {
        $filtered = apply_filters('genesis_footer_credits', '[footer_childtheme_link] &middot; [footer_genesis_link] &middot; [footer_wordpress_link]');
        $creds_text = __('Copyright', 'genesis') . ' [footer_copyright] ' . $filtered . ' &middot; [footer_loginout]';
    }
    $output = '<div class="gototop"><p>' . $backtotop_text . '</p></div>' . '<div class="creds"><p>' . g_ent($creds_text) . '</p></div>';
    echo apply_filters('genesis_footer_output', $output, $backtotop_text, $creds_text);
}
Exemplo n.º 6
0
/**
 * Using a filter, we're replacing the default search form
 * with one of our own, specific to Genesis.
 *
 * @since 0.2
 */
function genesis_search_form()
{
    $search_text = get_search_query() ? esc_attr(apply_filters('the_search_query', get_search_query())) : apply_filters('genesis_search_text', sprintf(esc_attr__('Search this website %s', 'genesis'), g_ent('&hellip;')));
    $button_text = apply_filters('genesis_search_button_text', esc_attr__('Search', 'genesis'));
    $onfocus = " onfocus=\"if (this.value == '{$search_text}') {this.value = '';}\"";
    $onblur = " onblur=\"if (this.value == '') {this.value = '{$search_text}';}\"";
    $form = '
		<form method="get" class="searchform" action="' . home_url() . '/" >
			<input type="text" value="' . $search_text . '" name="s" class="s"' . $onfocus . $onblur . ' />
			<input type="submit" class="searchsubmit" value="' . $button_text . '" />
		</form>
	';
    return apply_filters('genesis_search_form', $form, $search_text, $button_text);
}
Exemplo n.º 7
0
/**
 * Echo the contents of the footer. Execute any shortcodes that might be present.
 *
 * @since 1.0.1
 */
function genesis_do_footer()
{
    // Build the filterable text strings. Includes shortcodes.
    $backtotop_text = apply_filters('genesis_footer_backtotop_text', '[footer_backtotop]');
    $creds_text = apply_filters('genesis_footer_creds_text', sprintf('[footer_copyright before="%1$s "] [footer_childtheme_link after=" %2$s"] [footer_genesis_link after=" %3$s"] [footer_wordpress_link after=" %3$s"] [footer_loginout]', __('Copyright', 'genesis'), __('on', 'genesis'), g_ent('&middot;')));
    // For backward compatibility (pre-1.1 filter)
    if (apply_filters('genesis_footer_credits', FALSE)) {
        $filtered = apply_filters('genesis_footer_credits', sprintf('[footer_childtheme_link after=" %s"] [footer_genesis_link after=" %s"] [footer_wordpress_link]', __('on', 'genesis'), g_ent('&middot;')));
        $creds_text = sprintf('[footer_copyright before="%s "] %s [footer_loginout before="%s "]', __('Copyright', 'genesis'), $filtered, g_ent('&middot;'));
    }
    $backtotop = $backtotop_text ? sprintf('<div class="gototop"><p>%s</p></div>', $backtotop_text) : '';
    $creds = $creds_text ? sprintf('<div class="creds"><p>%s</p></div>', g_ent($creds_text)) : '';
    $output = $backtotop . $creds;
    echo apply_filters('genesis_footer_output', $output, $backtotop_text, $creds_text);
}
 function widget($args, $instance)
 {
     extract($args);
     $instance = wp_parse_args((array) $instance, array('title' => '', 'page_id' => '', 'show_image' => 0, 'image_alignment' => '', 'image_size' => '', 'show_title' => 0, 'show_byline' => 0, 'show_content' => 0, 'content_limit' => '', 'more_text' => ''));
     echo $before_widget;
     // Set up the author bio
     if (!empty($instance['title'])) {
         echo $before_title . apply_filters('widget_title', $instance['title']) . $after_title;
     }
     $featured_page = new WP_Query(array('page_id' => $instance['page_id']));
     if ($featured_page->have_posts()) {
         while ($featured_page->have_posts()) {
             $featured_page->the_post();
             echo '<div ';
             post_class();
             echo '>';
             if (!empty($instance['show_image'])) {
                 printf('<a href="%s" title="%s" class="%s">%s</a>', get_permalink(), the_title_attribute('echo=0'), esc_attr($instance['image_alignment']), genesis_get_image(array('format' => 'html', 'size' => $instance['image_size'])));
             }
             if (!empty($instance['show_title'])) {
                 printf('<h2><a href="%s" title="%s">%s</a></h2>', get_permalink(), the_title_attribute('echo=0'), the_title_attribute('echo=0'));
             }
             if (!empty($instance['show_byline'])) {
                 echo '<p class="byline">';
                 the_time('F j, Y');
                 echo ' ' . __('by', 'genesis') . ' ';
                 the_author_posts_link();
                 echo g_ent(' &middot; ');
                 comments_popup_link(__('Leave a Comment', 'genesis'), __('1 Comment', 'genesis'), __('% Comments', 'genesis'));
                 echo ' ';
                 edit_post_link(__('(Edit)', 'genesis'), '', '');
                 echo '</p>';
             }
             if (!empty($instance['show_content'])) {
                 if (empty($instance['content_limit'])) {
                     the_content($instance['more_text']);
                 } else {
                     the_content_limit((int) $instance['content_limit'], esc_html($instance['more_text']));
                 }
             }
             echo '</div><!--end post_class()-->' . "\n\n";
         }
     }
     echo $after_widget;
     wp_reset_query();
 }
Exemplo n.º 9
0
/**
 * Returns content stripped down and limited content.
 *
 * Strips out tags and shortcodes, limits the output to $max_char characters,
 * and appends an ellipses and more link to the end.
 *
 * @since 0.1.0
 *
 * @param integer $max_characters The maximum number of characters to return
 * @param string $more_link_text Optional. Text of the more link. Default is "(more...)"
 * @param bool $stripteaser Optional. Strip teaser content before the more text. Default is false
 * @return string Limited content
 */
function get_the_content_limit($max_characters, $more_link_text = '(more...)', $stripteaser = false)
{
    $content = get_the_content('', $stripteaser);
    /** Strip tags and shortcodes so the content truncation count is done correctly */
    $content = strip_tags(strip_shortcodes($content), apply_filters('get_the_content_limit_allowedtags', '<script>,<style>'));
    /** Inline styles / scripts */
    $content = trim(preg_replace('#<(s(cript|tyle)).*?</\\1>#si', '', $content));
    /** Truncate $content to $max_char */
    $content = genesis_truncate_phrase($content, $max_characters);
    /** More link? */
    if ($more_link_text) {
        $link = apply_filters('get_the_content_more_link', sprintf('%s <a href="%s" class="more-link">%s</a>', g_ent('&hellip;'), get_permalink(), $more_link_text), $more_link_text);
        $output = sprintf('<p>%s %s</p>', $content, $link);
    } else {
        $output = sprintf('<p>%s</p>', $content);
    }
    return apply_filters('get_the_content_limit', $output, $content, $link, $max_characters);
}
Exemplo n.º 10
0
/**
 * Show Footer Copyright Text
 *
 * @param array $atts Shortcode attributes
 * @return string
 */
function calibrefx_footer_copyright_shortcode($atts)
{
    $defaults = array('copyright' => '&copy;', 'first' => '', 'before' => '', 'after' => '');
    $atts = shortcode_atts($defaults, $atts);
    $output = $atts['before'] . $atts['copyright'];
    if ('' != $atts['first'] && date('Y') != $atts['first']) {
        $output .= $atts['first'] . g_ent('&ndash;');
    }
    $output .= ' ' . date('Y') . $atts['after'];
    return apply_filters('calibrefx_footer_copyright_shortcode', $output, $atts);
}
/**
 * This next section defines functions that contain the content of the "boxes" that will be
 * output by default on the "Theme Settings" page. There's a bunch of them.
 *
 * FWIW, you can copy this syntax and load your own boxes on the theme settings page too.
 */
function genesis_theme_settings_info_box()
{
    ?>
	<p><strong><?php 
    _e('Version:', 'genesis');
    ?>
</strong> <?php 
    genesis_option('theme_version');
    ?>
 <?php 
    echo g_ent('&middot;');
    ?>
 <strong><?php 
    _e('Released:', 'genesis');
    ?>
</strong> <?php 
    echo PARENT_THEME_RELEASE_DATE;
    ?>
</p>
	
	<p><input type="checkbox" name="<?php 
    echo GENESIS_SETTINGS_FIELD;
    ?>
[show_info]" id="<?php 
    echo GENESIS_SETTINGS_FIELD;
    ?>
[show_info]" value="1" <?php 
    checked(1, genesis_get_option('show_info'));
    ?>
 /> <label for="<?php 
    echo GENESIS_SETTINGS_FIELD;
    ?>
[show_info]"><?php 
    _e('Display Theme Information in your document source', 'genesis');
    ?>
</label></p>
	
	<p><span class="description"><?php 
    _e('<b>NOTE:</b> This can be helpful for diagnosing problems with your theme when seeking support in the forums.', 'genesis');
    ?>
</span></p>
	
	<p><input type="checkbox" name="<?php 
    echo GENESIS_SETTINGS_FIELD;
    ?>
[update]" id="<?php 
    echo GENESIS_SETTINGS_FIELD;
    ?>
[update]" value="1" <?php 
    checked(1, genesis_get_option('update'));
    ?>
 <?php 
    disabled(0, is_super_admin());
    ?>
 /> <label for="<?php 
    echo GENESIS_SETTINGS_FIELD;
    ?>
[update]"><?php 
    _e('Enable Automatic Updates', 'genesis');
    ?>
</label></p>
	
	<p><input type="checkbox" name="<?php 
    echo GENESIS_SETTINGS_FIELD;
    ?>
[update_email]" id="<?php 
    echo GENESIS_SETTINGS_FIELD;
    ?>
[update_email]" value="1" <?php 
    checked(1, genesis_get_option('update_email'));
    ?>
 <?php 
    disabled(0, is_super_admin());
    ?>
 /> <label for="<?php 
    echo GENESIS_SETTINGS_FIELD;
    ?>
[update_email]"><?php 
    _e('Notify', 'genesis');
    ?>
</label> <input type="text" name="<?php 
    echo GENESIS_SETTINGS_FIELD;
    ?>
[update_email_address]" id="<?php 
    echo GENESIS_SETTINGS_FIELD;
    ?>
[update_email_address]" value="<?php 
    echo esc_attr(genesis_option('update_email_address'));
    ?>
" size="12" <?php 
    disabled(0, is_super_admin());
    ?>
 /> <label for="<?php 
    echo GENESIS_SETTINGS_FIELD;
    ?>
[update_email_address]"><?php 
    _e('when updates are available', 'genesis');
    ?>
</label></p>
	
	<p><span class="description"><?php 
    _e('If you provide an email address in the above field, your blog can email you when a new version of Genesis is available', 'genesis');
    ?>
</span></p>
<?php 
}
/**
 * Customize the post meta function
 */
function blissful_post_meta_filter($post_meta)
{
    return g_ent('[post_categories] &middot; [post_tags]');
}
Exemplo n.º 13
0
/**
 * Return filtered post title.
 *
 * This function does 3 things:
 * 1. Pulls the values for $sep and $seplocation, uses defaults if necessary
 * 2. Determines if the site title should be appended
 * 3. Allows the user to set a custom title on a per-page/post basis
 *
 * @since 0.1.3
 *
 * @uses genesis_get_seo_option() Get SEO setting value
 * @uses genesis_get_custom_field() Get custom field value
 *
 * @global WP_Query $wp_query
 * @param string $title Existing page title
 * @param string $sep Separator character(s). Default is <code>g_ent( '&mdash;' )</code> if not set
 * @param string $seplocation Separator location - "left" or "right". Default is "right" if not set
 * @return string Page title
 */
function genesis_default_title($title, $sep, $seplocation)
{
    global $wp_query;
    if (is_feed()) {
        return trim($title);
    }
    $sep = genesis_get_seo_option('doctitle_sep') ? genesis_get_seo_option('doctitle_sep') : g_ent('&mdash;');
    $seplocation = genesis_get_seo_option('doctitle_seplocation') ? genesis_get_seo_option('doctitle_seplocation') : 'right';
    /**	If viewing the home page */
    if (is_front_page()) {
        /** Determine the doctitle */
        $title = genesis_get_seo_option('home_doctitle') ? genesis_get_seo_option('home_doctitle') : get_bloginfo('name');
        /** Append site description, if necessary */
        $title = genesis_get_seo_option('append_description_home') ? $title . " {$sep} " . get_bloginfo('description') : $title;
    }
    /**	if viewing a post / page / attachment */
    if (is_singular()) {
        /**	The User Defined Title (Genesis) */
        if (genesis_get_custom_field('_genesis_title')) {
            $title = genesis_get_custom_field('_genesis_title');
        } elseif (genesis_get_custom_field('_aioseop_title')) {
            $title = genesis_get_custom_field('_aioseop_title');
        } elseif (genesis_get_custom_field('_headspace_page_title')) {
            $title = genesis_get_custom_field('_headspace_page_title');
        } elseif (genesis_get_custom_field('thesis_title')) {
            $title = genesis_get_custom_field('thesis_title');
        } elseif (genesis_get_custom_field('title_tag')) {
            $title = genesis_get_custom_field('title_tag');
        } elseif (genesis_get_custom_field('title')) {
            $title = genesis_get_custom_field('title');
        }
    }
    if (is_category()) {
        //$term = get_term( get_query_var('cat'), 'category' );
        $term = $wp_query->get_queried_object();
        $title = !empty($term->meta['doctitle']) ? $term->meta['doctitle'] : $title;
    }
    if (is_tag()) {
        //$term = get_term( get_query_var('tag_id'), 'post_tag' );
        $term = $wp_query->get_queried_object();
        $title = !empty($term->meta['doctitle']) ? $term->meta['doctitle'] : $title;
    }
    if (is_tax()) {
        $term = get_term_by('slug', get_query_var('term'), get_query_var('taxonomy'));
        $title = !empty($term->meta['doctitle']) ? wp_kses_stripslashes(wp_kses_decode_entities($term->meta['doctitle'])) : $title;
    }
    if (is_author()) {
        $user_title = get_the_author_meta('doctitle', (int) get_query_var('author'));
        $title = $user_title ? $user_title : $title;
    }
    /**	If we don't want site name appended, or if we're on the home page */
    if (!genesis_get_seo_option('append_site_title') || is_front_page()) {
        return esc_html(trim($title));
    }
    /** Else append the site name */
    $title = 'right' == $seplocation ? $title . " {$sep} " . get_bloginfo('name') : get_bloginfo('name') . " {$sep} " . $title;
    return esc_html(trim($title));
}
 public function pagination_older_newer()
 {
     $older_link = get_next_posts_link(apply_filters('genesis_older_link_text', g_ent('&larr; ') . __('Older', 'genesis')));
     $newer_link = get_previous_posts_link(apply_filters('genesis_newer_link_text', __('Newer', 'genesis') . g_ent(' &rarr;')));
     if (genesis_get_option('posts_nav') == 'prev-next') {
         $older_link = get_previous_posts_link(apply_filters('genesis_prev_link_text', g_ent('&laquo; ') . __('Previous Page', 'genesis')));
         $newer_link = get_next_posts_link(apply_filters('genesis_next_link_text', __('Next Page', 'genesis') . g_ent(' &raquo;')));
     }
     $older = $older_link ? '<li class="previous">' . $older_link . '</li>' : '';
     $newer = $newer_link ? '<li class="next">' . $newer_link . '</li>' : '';
     $nav = '<ul class="pager">' . $older . $newer . '</ul><!-- .pager -->';
     if ($older || $newer) {
         echo $nav;
     }
 }
Exemplo n.º 15
0
/**
 * Echo the contents of the footer.
 *
 * Execute any shortcodes that might be present.
 *
 * Several filters are applied here, which can be used for customising the output:
 *   genesis_footer_backtotop_text,
 *   genesis_footer_creds_text,
 *   genesis_footer_output.
 *
 * @since 1.0.1
 *
 * @uses g_ent() Pass entities through a filter
 */
function genesis_do_footer()
{
    /** Build the text strings. Includes shortcodes */
    $backtotop_text = '[footer_backtotop]';
    $creds_text = sprintf('[footer_copyright before="%s "] &middot; [footer_childtheme_link before="" after=" %s"] [footer_genesis_link url="http://www.studiopress.com/" before=""] &middot; [footer_wordpress_link] &middot; [footer_loginout]', __('Copyright', 'genesis'), __('on', 'genesis'));
    /** Filter the text strings */
    $backtotop_text = apply_filters('genesis_footer_backtotop_text', $backtotop_text);
    $creds_text = apply_filters('genesis_footer_creds_text', $creds_text);
    $backtotop = $backtotop_text ? sprintf('<div class="gototop"><p>%s</p></div>', $backtotop_text) : '';
    $creds = $creds_text ? sprintf('<div class="creds"><p>%s</p></div>', g_ent($creds_text)) : '';
    $output = $backtotop . $creds;
    echo apply_filters('genesis_footer_output', $output, $backtotop_text, $creds_text);
}
/**
 * Display numeric posts navigation (similar to WP-PageNavi)
 *
 * @since 0.2.3
 */
function genesis_numeric_posts_nav()
{
    if (is_singular()) {
        return;
    }
    // do nothing
    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);
    echo '<div class="navigation"><ul>' . "\n";
    //	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;
    }
    //	Previous Post Link
    if (get_previous_posts_link()) {
        printf('<li>%s</li>' . "\n", get_previous_posts_link(g_ent(__('&laquo; Previous', 'genesis'))));
    }
    //	Link to first Page, plus ellipeses, if necessary
    if (!in_array(1, $links)) {
        if ($paged == 1) {
            $current = ' class="active"';
        } else {
            $current = null;
        }
        printf('<li %s><a href="%s">%s</a></li>' . "\n", $current, get_pagenum_link(1), '1');
        if (!in_array(2, $links)) {
            echo g_ent('<li>&hellip;</li>');
        }
    }
    //	Link to Current page, plus 2 pages in either direction (if necessary).
    sort($links);
    foreach ((array) $links as $link) {
        $current = $paged == $link ? 'class="active"' : '';
        printf('<li %s><a href="%s">%s</a></li>' . "\n", $current, 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 g_ent('<li>&hellip;</li>') . "\n";
        }
        $current = $paged == $max ? 'class="active"' : '';
        printf('<li %s><a href="%s">%s</a></li>' . "\n", $current, get_pagenum_link($max), $max);
    }
    //	Next Post Link
    if (get_next_posts_link()) {
        printf('<li>%s</li>' . "\n", get_next_posts_link(g_ent(__('Next &raquo;', 'genesis'))));
    }
    echo '</ul></div>' . "\n";
}
Exemplo n.º 17
0
function hbmi_next_page_link($text)
{
    return __('Next Page', CHILD_DOMAIN) . g_ent(' &raquo; ');
}
Exemplo n.º 18
0
/** 
 * Customize the older posts link
 *
 * @param  string $text Default older posts link.
 * (default: __( 'Older Posts', 'genesis' ) . '&#x000BB;' )
 * @return string Modified older posts link.
 */
function gs_older_link_text($text)
{
    return g_ent('&laquo; ') . __('Custom Older Posts Link', CHILD_DOMAIN);
}
Exemplo n.º 19
0
/**
 * Echoes post navigation in page numbers format (similar to WP-PageNavi).
 *
 * 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
 *
 * @uses g_ent() Pass entities through filter
 *
 * @global WP_Query $wp_query Query object
 * @return null Returns early if on a single post or page, or only 1 page present
 */
function genesis_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;
    }
    echo '<div class="navigation"><ul>' . "\n";
    /**	Previous Post Link */
    if (get_previous_posts_link()) {
        printf('<li>%s</li>' . "\n", get_previous_posts_link(apply_filters('genesis_prev_link_text', g_ent('&laquo; ') . __('Previous Page', 'genesis'))));
    }
    /**	Link to first page, plus ellipses if necessary */
    if (!in_array(1, $links)) {
        $class = 1 == $paged ? ' class="active"' : '';
        printf('<li%s><a href="%s">%s</a></li>' . "\n", $class, esc_url(get_pagenum_link(1)), '1');
        if (!in_array(2, $links)) {
            echo g_ent('<li>&hellip;</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"' : '';
        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 g_ent('<li>&hellip;</li>') . "\n";
        }
        $class = $paged == $max ? ' class="active"' : '';
        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>%s</li>' . "\n", get_next_posts_link(apply_filters('genesis_next_link_text', __('Next Page', 'genesis') . g_ent(' &raquo;'))));
    }
    echo '</ul></div>' . "\n";
}
Exemplo n.º 20
0
/**
 * The grid loop - a specific implementation of a custom loop.
 *
 * Outputs markup compatible with a Feature + Grid style layout.
 * All normal loop hooks present, except for genesis_post_content.
 *
 * The arguments can be filtered by the genesis_grid_loop_args filter.
 *
 * @since 1.5.0
 *
 * @uses g_ent() Pass entities through filter
 * @uses genesis_custom_loop() Do custom loop
 * @uses genesis_standard_loop() Do standard loop
 * @uses genesis_reset_loop() Restores all default post loop output by rehooking all default functions
 *
 * @global array $_genesis_loop_args Associative array for grid loop configuration
 * @global string $query_string Query string
 * @param array $args Associative array for grid loop configuration
 * @return null Returns early if posts_per_page is fewer than features
 */
function genesis_grid_loop($args = array())
{
    /** Global vars */
    global $_genesis_loop_args, $query_string;
    /** Parse args */
    $args = apply_filters('genesis_grid_loop_args', wp_parse_args($args, array('loop' => 'standard', 'features' => 2, 'features_on_all' => false, 'feature_image_size' => 0, 'feature_image_class' => 'alignleft post-image', 'feature_content_limit' => 0, 'grid_image_size' => 'thumbnail', 'grid_image_class' => 'alignleft post-image', 'grid_content_limit' => 0, 'more' => g_ent(__('Read more&hellip;', 'genesis')), 'posts_per_page' => get_option('posts_per_page'), 'paged' => get_query_var('paged') ? get_query_var('paged') : 1)));
    /** Error handler */
    if ($args['posts_per_page'] < $args['features']) {
        trigger_error(sprintf(__('You are using invalid arguments with the %s function.', 'genesis'), __FUNCTION__));
        return;
    }
    /** Potentially remove features on page 2+ */
    if (!$args['features_on_all'] && $args['paged'] > 1) {
        $args['features'] = 0;
    }
    /** Set global loop args */
    $_genesis_loop_args = wp_parse_args($args, $query_string);
    /** Remove some unnecessary stuff from the grid loop */
    remove_action('genesis_before_post_title', 'genesis_do_post_format_image');
    remove_action('genesis_post_content', 'genesis_do_post_image');
    remove_action('genesis_post_content', 'genesis_do_post_content');
    /** Custom loop output */
    add_filter('post_class', 'genesis_grid_loop_post_class');
    add_action('genesis_post_content', 'genesis_grid_loop_content');
    /** Set query args */
    $args = $_genesis_loop_args;
    if (isset($args['features']) && is_numeric($args['features'])) {
        unset($args['features']);
    }
    /** The loop */
    if ('custom' == $_genesis_loop_args['loop']) {
        genesis_custom_loop($args);
    } else {
        query_posts($args);
        genesis_standard_loop();
    }
    /** Reset loops */
    genesis_reset_loops();
    remove_filter('post_class', 'genesis_grid_loop_post_class');
    remove_action('genesis_post_content', 'genesis_grid_loop_content');
}
/**
 * This function is the comment callback for <code>genesis_default_comment_list()</code>
 * 
 * @since 1.0
 */
function genesis_comment_callback($comment, $args, $depth)
{
    $GLOBALS['comment'] = $comment;
    ?>
	
	<li <?php 
    comment_class();
    ?>
 id="comment-<?php 
    comment_ID();
    ?>
">
	
		<?php 
    genesis_before_comment();
    ?>
	
		<div class="comment-author vcard">
			<?php 
    echo get_avatar($comment, $size = $args['avatar_size']);
    ?>
			<?php 
    printf(__('<cite class="fn">%s</cite> <span class="says">%s:</span>', 'genesis'), get_comment_author_link(), apply_filters('comment_author_says_text', __('says', 'genesis')));
    ?>
	 	</div><!-- end .comment-author -->

		<div class="comment-meta commentmetadata">
			<a href="<?php 
    echo esc_attr(get_comment_link($comment->comment_ID));
    ?>
"><?php 
    printf(__('%1$s at %2$s', 'genesis'), get_comment_date(), get_comment_time());
    ?>
</a>
			<?php 
    edit_comment_link(__('Edit', 'genesis'), g_ent('&bull; '), '');
    ?>
		</div><!-- end .comment-meta -->

		<div class="comment-content">
			<?php 
    if ($comment->comment_approved == '0') {
        ?>
				<p class="alert"><?php 
        _e('Your comment is awaiting moderation.', 'genesis');
        ?>
</p>
			<?php 
    }
    ?>
			
			<?php 
    comment_text();
    ?>
		</div><!-- end .comment-content -->

		<div class="reply">
			<?php 
    comment_reply_link(array_merge($args, array('depth' => $depth, 'max_depth' => $args['max_depth'])));
    ?>
		</div>
		
		<?php 
    genesis_after_comment();
    ?>
		
	<?php 
    // no ending </li> tag because of comment threading
}
Exemplo n.º 22
0
/**
 * This next section defines functions that contain the content of the "boxes" that will be
 * output by default on the "Theme Settings" page. There's a bunch of them.
 *
 * FWIW, you can copy this syntax and load your own boxes on the theme settings page too.
 */
function genesis_theme_settings_info_box()
{
    ?>
	<p><strong><?php 
    _e('Version:', 'genesis');
    ?>
</strong> <?php 
    genesis_option('theme_version');
    ?>
 <?php 
    echo g_ent('&middot;');
    ?>
 <strong><?php 
    _e('Released:', 'genesis');
    ?>
</strong> <?php 
    echo PARENT_THEME_RELEASE_DATE;
    ?>
</p>

	<p><input type="checkbox" name="<?php 
    echo GENESIS_SETTINGS_FIELD;
    ?>
[show_info]" id="<?php 
    echo GENESIS_SETTINGS_FIELD;
    ?>
[show_info]" value="1" <?php 
    checked(1, genesis_get_option('show_info'));
    ?>
 /> <label for="<?php 
    echo GENESIS_SETTINGS_FIELD;
    ?>
[show_info]"><?php 
    _e('Display Theme Information in your document source', 'genesis');
    ?>
</label></p>

	<p><span class="description"><?php 
    sprintf(__('This can be helpful for diagnosing problems with your theme when seeking assistance in the <a href="%s" target="_blank">support forums</a>.', 'genesis'), 'http://www.studiopress.com/support/');
    ?>
</span></p>

	<p><input type="checkbox" name="<?php 
    echo GENESIS_SETTINGS_FIELD;
    ?>
[update]" id="<?php 
    echo GENESIS_SETTINGS_FIELD;
    ?>
[update]" value="1" <?php 
    checked(1, genesis_get_option('update'));
    ?>
 <?php 
    disabled(0, is_super_admin());
    ?>
 /> <label for="<?php 
    echo GENESIS_SETTINGS_FIELD;
    ?>
[update]"><?php 
    _e('Enable Automatic Updates', 'genesis');
    ?>
</label></p>

	<div id="genesis_update_notification_setting">
		<p><input type="checkbox" name="<?php 
    echo GENESIS_SETTINGS_FIELD;
    ?>
[update_email]" id="<?php 
    echo GENESIS_SETTINGS_FIELD;
    ?>
[update_email]" value="1" <?php 
    checked(1, genesis_get_option('update_email'));
    ?>
 <?php 
    disabled(0, is_super_admin());
    ?>
 /> <label for="<?php 
    echo GENESIS_SETTINGS_FIELD;
    ?>
[update_email]"><?php 
    _e('Notify', 'genesis');
    ?>
</label> <input type="text" name="<?php 
    echo GENESIS_SETTINGS_FIELD;
    ?>
[update_email_address]" id="<?php 
    echo GENESIS_SETTINGS_FIELD;
    ?>
[update_email_address]" value="<?php 
    echo esc_attr(genesis_option('update_email_address'));
    ?>
" size="30" <?php 
    disabled(0, is_super_admin());
    ?>
 /> <label for="<?php 
    echo GENESIS_SETTINGS_FIELD;
    ?>
[update_email_address]"><?php 
    _e('when updates are available', 'genesis');
    ?>
</label></p>

		<p><span class="description"><?php 
    _e('If you provide an email address above, your blog can email you when a new version of Genesis is available.', 'genesis');
    ?>
</span></p>
	</div>
<?php 
}