/** * Outputs the widget based on the arguments input through the widget controls. * * @since 0.6.0 */ function widget($sidebar, $instance) { extract($sidebar); /* Set the $args for wp_list_authors() to the $instance array. */ $args = $instance; /* Overwrite the $echo argument and set it to false. */ $args['echo'] = false; /* Output the theme's $before_widget wrapper. */ echo $before_widget; /* If a title was input by the user, display it. */ if (!empty($instance['title'])) { echo $before_title . apply_filters('widget_title', $instance['title'], $instance, $this->id_base) . $after_title; } /* Get the authors list. */ $authors = str_replace(array("\r", "\n", "\t"), '', wp_list_authors($args)); /* If 'list' is the style and the output should be HTML, wrap the authors in a <ul>. */ if ('list' == $args['style'] && $args['html']) { $authors = '<ul class="xoxo authors">' . $authors . '</ul><!-- .xoxo .authors -->'; } elseif ('none' == $args['style'] && $args['html']) { $authors = '<p class="authors">' . $authors . '</p><!-- .authors -->'; } /* Display the authors list. */ echo $authors; /* Close the theme's widget wrapper. */ echo $after_widget; }
function widget($args, $instance) { extract($args, EXTR_SKIP); $title = apply_filters('widget_title', empty($instance['title']) ? __('Owners', 'rolopress') : $instance['title']); $style = $instance['style']; $feed = $instance['feed']; $feed_image = $instance['feed_image']; $optioncount = isset($instance['optioncount']) ? $instance['optioncount'] : false; $exclude_admin = isset($instance['exclude_admin']) ? $instance['exclude_admin'] : false; $show_fullname = isset($instance['show_fullname']) ? $instance['show_fullname'] : false; $hide_empty = isset($instance['hide_empty']) ? $instance['hide_empty'] : false; $html = isset($instance['html']) ? $instance['html'] : false; $owners = array('optioncount' => $optioncount, 'exclude_admin' => $exclude_admin, 'show_fullname' => $show_fullname, 'hide_empty' => $hide_empty, 'feed' => $feed, 'feed_image' => $feed_image, 'style' => $style, 'html' => $html, 'echo' => 0); echo $before_widget; if ($title) { echo "\n\t\t\t" . $before_title . $title . $after_title; } if ('list' == $style && $html) { echo "\n\t\t\t" . '<ul class="xoxo owners">'; } echo "\n\t\t\t\t" . str_replace(array("\r", "\n", "\t"), '', wp_list_authors($owners)); if ('list' == $style && $html) { echo "\n\t\t\t" . '</ul><!-- .xoxo .owners -->'; } echo $after_widget; }
function authors_block($options) { $mydirname = empty($options[0]) ? 'xpress' : $options[0]; $this_template = empty($options[1]) ? 'db:' . $mydirname . '_block_authors.html' : trim($options[1]); $optioncount = empty($options[2]) ? 0 : 1; $exclude_admin = empty($options[3]) ? 0 : 1; $show_fullname = empty($options[4]) ? 0 : 1; $hide_empty = empty($options[5]) ? 0 : 1; $mydirpath = get_xpress_dir_path(); if (xpress_is_wp_version('<', '2.3')) { $param_str = 'optioncount=' . $optioncount . '&exclude_admin=' . $exclude_admin . '&show_fullname=' . $show_fullname . '&hide_empty=' . $hide_empty; ob_start(); wp_list_authors($param_str); //WP2011 wp_list_authors() used only parse_str() $list_authors = ob_get_contents(); ob_end_clean(); } else { $param = array('optioncount' => $optioncount, 'exclude_admin' => $exclude_admin, 'show_fullname' => $show_fullname, 'hide_empty' => $hide_empty, 'feed' => '', 'feed_image' => '', 'echo' => false); $list_authors = wp_list_authors($param); } if (xpress_is_multi_user()) { $all_link = '<li>' . '<a href="' . get_bloginfo('url') . '" title="' . __('All Authors', 'xpress') . '">' . __('All Authors', 'xpress') . '</a></li>'; } else { $all_link = ''; } $output = "<ul>\n" . $all_link . $list_authors . "\n</ul>\n"; $block['authors'] = $output; return $block; }
/** * This function outputs sitemap-esque columns displaying all pages, * categories, authors, monthly archives, and recent posts. * * @since 1.6 */ function genesis_page_archive_content() { // Pause Exclude Pages plugin functionality. pause_exclude_pages(); ?> <h4><?php _e('Pages:', 'genesis'); ?> </h4> <ul> <?php wp_list_pages('title_li='); ?> </ul> <h4><?php _e('Categories:', 'genesis'); ?> </h4> <ul> <?php wp_list_categories('sort_column=name&title_li='); ?> </ul> <h4><?php _e('Authors:', 'genesis'); ?> </h4> <ul> <?php wp_list_authors('exclude_admin=0&optioncount=1'); ?> </ul> <h4><?php _e('Monthly:', 'genesis'); ?> </h4> <ul> <?php wp_get_archives('type=monthly'); ?> </ul> <h4><?php _e('Recent Posts:', 'genesis'); ?> </h4> <ul> <?php wp_get_archives('type=postbypost&limit=100'); ?> </ul> <?php // Resume Exclude Pages plugin functionality. resume_exclude_pages(); }
function widget_author_info_card($args) { if (get_query_var('author_name')) { $curauth = get_userdatabylogin(get_query_var('author_name')); } else { $curauth = get_userdata(get_query_var('author')); } extract($args); echo $before_widget . $before_title; // If its the author page. if (get_option('sa_add_to_author_page') == 'yes' && is_author()) { $title = $curauth->display_name; echo $title . $after_title; echo sa_author_info_card($curauth); } else { $title = "List of Authors"; echo $title . $after_title; ob_start(); wp_list_authors('show_fullname=1&optioncount=1'); $author_list = ob_get_contents(); ob_end_clean(); echo "<ul>{$author_list}</ul>"; } echo $after_widget; }
function Grafik_Functions_Shortcode_BlogAuthors($atts) { $a = shortcode_atts(array('orderby' => 'name', 'order' => 'ASC', 'number' => 0, 'optioncount' => 0, 'exclude_admin' => 1, 'show_fullname' => 0, 'hide_empty' => 1, 'heading' => 'Blog Authors', 'class' => '', 'id' => ''), $atts, "BlogAuthors"); $a['echo'] = 0; $content = '<ul>' . wp_list_authors($a) . '</ul>'; return '<div class="theme-blogauthors' . (empty($a['class']) ? null : ' ' . $a['class']) . '"' . (empty($a['id']) ? null : ' id="' . $a['id'] . '"') . '>' . '<div class="theme-blogauthors-interior">' . (empty($a['heading']) ? null : '<h2>' . $a['heading'] . '</h2>') . (empty($content) ? null : $content) . '</div>' . '</div>'; }
function widget_sidebar() { // eiger Code Start echo '<li class="widget widget-autorenwidget"><h3 class="widgettitle style-head">Contributing People</h3><hr class="widget-hr" /><ul>'; wp_list_authors('exclude_admin=0&show_fullname=true'); echo '</ul></li>'; // eiger Code Ende }
function sub_author_listing() { ob_start(); ?> <div class="list-author"> <?php wp_list_authors('show_fullname=1&optioncount=0&orderby=post_count&order=DESC'); ?> </div> <?php $myvariable = ob_get_clean(); return $myvariable; }
function dt_sitemap_shortcode() { $output = '<div class="sitemap cf">'; $output .= '<div class="one-half">'; $output .= '<h3>' . __('Pages', 'engine') . '</h3>'; $output .= '<ul>' . wp_list_pages('title_li=&echo=0') . '</ul>'; $output .= '<h3>' . __('Categories', 'engine') . '</h3>'; $output .= '<ul>' . wp_list_categories('title_li=&show_count=1&echo=0') . '</ul>'; $output .= '<h3>' . __('Authors', 'engine') . '</h3>'; $output .= '<ul>' . wp_list_authors('exclude_admin=0&optioncount=1&echo=0') . '</ul>'; $output .= '</div>'; $output .= '<div class="one-half column-last">'; $output .= '<h3>' . __('Monthly Archives', 'engine') . '</h3>'; $output .= '<ul>' . wp_get_archives('type=monthly&show_post_count=1&echo=0') . '</ul>'; $output .= '<h3>' . __('Latest Posts', 'engine') . '</h3>'; $output .= '<ul>' . wp_get_archives('type=postbypost&limit=20&echo=0') . '</ul>'; $output .= '</div>'; $output .= '</div><!-- .sitemap -->'; return $output; }
/** * Outputs the widget based on the arguments input through the widget controls. * @since 0.6 */ function widget( $args, $instance ) { /* If a transient has been saved with the widget information, use it. */ $transient = get_transient( "{$this->prefix}_widget_{$args['widget_id']}" ); if ( $transient ) { echo $transient; return; } extract( $args, EXTR_SKIP ); $args = array(); $args['style'] = $instance['style']; $args['feed'] = $instance['feed']; $args['feed_image'] = $instance['feed_image']; $args['optioncount'] = isset( $instance['optioncount'] ) ? $instance['optioncount'] : false; $args['exclude_admin'] = isset( $instance['exclude_admin'] ) ? $instance['exclude_admin'] : false; $args['show_fullname'] = isset( $instance['show_fullname'] ) ? $instance['show_fullname'] : false; $args['hide_empty'] = isset( $instance['hide_empty'] ) ? $instance['hide_empty'] : false; $args['html'] = isset( $instance['html'] ) ? $instance['html'] : false; $args['echo'] = false; $authors_widget = $before_widget; if ( $instance['title'] ) $authors_widget .= $before_title . apply_filters( 'widget_title', $instance['title'], $instance, $this->id_base ) . $after_title; $authors = str_replace( array( "\r", "\n", "\t" ), '', wp_list_authors( $args ) ); if ( 'list' == $args['style'] && $args['html'] ) $authors = '<ul class="xoxo authors">' . $authors . '</ul><!-- .xoxo .authors -->'; $authors_widget .= $authors; $authors_widget .= $after_widget; set_transient( "{$this->prefix}_widget_{$widget_id}", $authors_widget, hybrid_get_transient_expiration() ); echo $authors_widget; }
/** * Outputs the widget based on the arguments input through the widget controls. * @since 0.6.0 */ function widget($args, $instance) { extract($args, EXTR_SKIP); /* Set up the arguments for wp_list_authors(). */ $args = array('order' => $instance['order'], 'orderby' => $instance['orderby'], 'number' => !empty($instance['number']) ? intval($instance['number']) : '', 'style' => $instance['style'], 'feed' => $instance['feed'], 'feed_image' => $instance['feed_image'], 'optioncount' => !empty($instance['optioncount']) ? true : false, 'exclude_admin' => !empty($instance['exclude_admin']) ? true : false, 'show_fullname' => !empty($instance['show_fullname']) ? true : false, 'hide_empty' => !empty($instance['hide_empty']) ? true : false, 'html' => !empty($instance['html']) ? true : false, 'echo' => false); /* Output the theme's $before_widget wrapper. */ echo $before_widget; /* If a title was input by the user, display it. */ if (!empty($instance['title'])) { echo $before_title . apply_filters('widget_title', $instance['title'], $instance, $this->id_base) . $after_title; } /* Get the authors list. */ $authors = str_replace(array("\r", "\n", "\t"), '', wp_list_authors($args)); /* If 'list' is the style and the output should be HTML, wrap the authors in a <ul>. */ if ('list' == $args['style'] && $args['html']) { $authors = '<ul class="xoxo authors">' . $authors . '</ul><!-- .xoxo .authors -->'; } /* Display the authors list. */ echo $authors; /* Close the theme's widget wrapper. */ echo $after_widget; }
function widget_authors($args) { // $args is an array of strings that help widgets to conform to // the active theme: before_widget, before_title, after_widget, // and after_title are the array keys. Default tags: li and h2. extract($args); // Each widget can store and retrieve its own options. // Here we retrieve any options that may have been set by the user // relying on widget defaults to fill the gaps. $options = array_merge(widget_authors_options(), get_option('widget_authors')); unset($options[0]); //returned by get_option(), but we don't need it // These lines generate our output. Widgets can be very complex // but as you can see here, they can also be very, very simple. echo $before_widget . $before_title . $options['Title'] . $after_title; // Translate yes/no values if (count($options)) { foreach ($options as $k => $v) { if ($k != 'Title' && $k != 'Style') { $options[$k] = $v ? 1 : 0; } } } // Create feed image parameter $feed_image = $options['Show Feed Image'] ? '&feed_image=' . LISTAUTHORS_URL . 'feed-icon-14x14.png&feed=RSS feed' : ''; ?> <!-- Authors --> <ul> <?php wp_list_authors('optioncount=' . $options['Option Count'] . '&exclude_admin=' . $options['Exclude Administrator'] . '&show_fullname=' . $options['Show Full Name'] . '&hide_empty=' . $options['Hide Empty'] . $feed_image); ?> </ul> <!-- /Authors --> <? echo $after_widget; }
/** * Shortcode function for listing the site's authors * Uses the wp_list_authors() function * @link http://codex.wordpress.org/Template_Tags/wp_list_authors * * @since 0.1 * @param array $attr Attributes attributed to the shortcode. */ function shortcode_list_authors($attr) { /* * Make sure we have boolean values instead of strings when needed */ if ($attr['optioncount']) { $attr['optioncount'] = shortcode_string_to_bool($attr['optioncount']); } if ($attr['exclude_admin']) { $attr['exclude_admin'] = shortcode_string_to_bool($attr['exclude_admin']); } if ($attr['show_fullname']) { $attr['show_fullname'] = shortcode_string_to_bool($attr['show_fullname']); } if ($attr['hide_empty']) { $attr['hide_empty'] = shortcode_string_to_bool($attr['hide_empty']); } $attr['echo'] = false; return wp_list_authors($attr); }
echo '<li><a href="' . get_tag_link($tag->term_id) . '">' . $tag->name . '</a></li> '; } } ?> </ul> </li> <li class="sitemap_col"> <div class="sitemap_title"> <h2><?php _e('Authors', 'framework'); ?> </h2> </div> <ul> <?php wp_list_authors('optioncount=1&exclude_admin=0'); ?> </ul> </li> </ul> </div> </div> </div> <?php if ($comments) { ?> <?php comments_template(); ?> <?php
wp_get_archives('type=monthly'); ?> </ul> <h3>Archives by Day:</h3> <ul><?php wp_get_archives('type=daily'); ?> </ul> <h3>Archives by Category:</h3> <ul><?php wp_list_categories('title_li='); ?> </ul> <h3>Archives by Author:</h3> <ul><?php wp_list_authors(); ?> </ul> </div> <div class="col"> <h3>All Pages:</h3> <ul><?php wp_list_pages('title_li='); ?> </ul> <h3>Archives by Tag:</h3> <?php wp_tag_cloud(); ?> </div> </section>
<div id="content" class="<?php echo $current_type; ?> " role="main"> <div <?php if (function_exists('post_class')) { post_class(); } ?> id="post-<?php the_ID(); ?> "> <div class="entry" role="article"> <ul> <?php wp_list_authors('exclude_admin=0'); ?> </ul> </div> </div> </div> <?php get_footer(); ?>
/** * Default template for 404 page */ function calibrefx_404() { ?> <div class="post hentry"> <h1 class="entry-title"><?php _e('Not Found, Error 404', 'calibrefx'); ?> </h1> <div class="entry-content"> <p> The page you are looking for no longer exists. Perhaps you can return back to the site's <a href="<?php bloginfo('home_url'); ?> ">homepage</a> and see if you can find what you are looking for. Or, you can try finding it with the information below. </p> <div> <div class="archive-page"> <h4><?php _e('Categories:', 'calibrefx'); ?> </h4> <ul> <?php wp_list_categories('sort_column=name&title_li='); ?> </ul> </div><!-- end .archive-page--> <div class="archive-page"> <h4><?php _e('Authors:', 'calibrefx'); ?> </h4> <ul> <?php wp_list_authors('exclude_admin=0&optioncount=1'); ?> </ul> <h4><?php _e('Monthly:', 'calibrefx'); ?> </h4> <ul> <?php wp_get_archives('type=monthly'); ?> </ul> <h4><?php _e('Recent Posts:', 'calibrefx'); ?> </h4> <ul> <?php wp_get_archives('type=postbypost&limit=100'); ?> </ul> </div><!-- end .archive-page--> <div class="clearfix"></div> </div> </div><!-- end .entry-content --> </div><!-- end .postclass --> <?php }
function wpseo_sitemap_shortcode() { // ============================================================================== // General Variables $options = get_option('wpseosms'); $checkOptions = get_option('wpseo_xml'); $goHtm = ''; //Hard Coded Styles if ($options['css-disable'] == '') { echo '<link rel="stylesheet" type="text/css" href="' . plugin_dir_url(__FILE__) . 'style.css" media="screen" />'; } $goHtm .= '<!-- WP SEO HTML Sitemap Plugin Start --><div id="wpseo_sitemap" class="columns_' . $options['columns'] . '">'; // ============================================================================== // Authors if ($checkOptions['disable_author_sitemap'] !== true) { $goHtm .= '<div id="sitemap_authors"><h3>' . __('Authors') . '</h3> <ul>'; $authEx = implode(", ", get_users('orderby=nicename&meta_key=wpseo_excludeauthorsitemap&meta_value=on')); $goHtm .= wp_list_authors(array('exclude_admin' => false, 'exclude' => $authEx, 'echo' => false)); $goHtm .= '</ul></div>'; } // ============================================================================== // Pages $pageCheck = get_pages(array('exclude' => $options['pageID'])); if (!empty($pageCheck) && $checkOptions['post_types-page-not_in_sitemap'] !== true) { $pageTitle = get_post_type_object('page'); $pageTitle = $pageTitle->label; $goHtm .= '<div id="sitemap_pages"><h3>' . $pageTitle . '</h3> <ul>'; $pageInc = ''; $getPages = get_all_page_ids(); foreach ($getPages as $pageID) { if ($pageID !== $options['pageID']) { if (get_post_meta($pageID, '_yoast_wpseo_meta-robots-noindex', true) === '1' && get_post_meta($pageID, '_yoast_wpseo_sitemap-include', true) !== 'always' || get_post_meta($pageID, '_yoast_wpseo_sitemap-include', true) === 'never' || get_post_meta($pageID, '_yoast_wpseo_redirect', true) !== '') { continue; } if ($pageInc == '') { $pageInc = $pageID; continue; } $pageInc .= ', ' . $pageID; } } $goHtm .= wp_list_pages(array('include' => $pageInc, 'title_li' => '', 'sort_column' => 'post_title', 'sort_order' => 'ASC', 'echo' => false)); $goHtm .= '</ul></div>'; } // ============================================================================== // Posts $postsTest = get_posts(); if (!empty($postsTest) && $checkOptions['post_types-post-not_in_sitemap'] !== true) { $postTitle = get_post_type_object('post'); $postTitle = $postTitle->label; if (get_option('show_on_front') == 'page') { $postsURL = get_permalink(get_option('page_for_posts')); $postTitle = get_the_title(get_option('page_for_posts')); } else { $postsURL = get_bloginfo('url'); } $goHtm .= '<div id="sitemap_posts"><h3>'; if ($postsURL !== '' && $postsURL !== get_permalink($options['pageID'])) { $goHtm .= '<a href="' . $postsURL . '">' . $postTitle . '</a>'; } else { $goHtm .= $postTitle; } $goHtm .= '</h3><ul>'; //Categories $cateEx = ''; $getCate = get_option('wpseo_taxonomy_meta'); if (!empty($getCate['category'])) { foreach ($getCate['category'] as $cateID => $item) { if ($item['wpseo_noindex'] == 'noindex' || $item['wpseo_sitemap_include'] == 'never') { if ($cateEx == '') { $cateEx = $cateID; } else { $cateEx .= ', ' . $cateID; } } } } $cats = get_categories('exclude=' . $cateEx); foreach ($cats as $cat) { $goHtm .= "<li style='margin-top:10px;'><h4><a href='" . esc_url(get_term_link($cat)) . "'>" . $cat->cat_name . "</a></h4>"; $goHtm .= "<ul>"; query_posts('posts_per_page=-1&cat=' . $cat->cat_ID); while (have_posts()) { the_post(); if (get_post_meta(get_the_ID(), '_yoast_wpseo_meta-robots-noindex', true) === '1' && get_post_meta(get_the_ID(), '_yoast_wpseo_sitemap-include', true) !== 'always' || get_post_meta(get_the_ID(), '_yoast_wpseo_sitemap-include', true) === 'never' || get_post_meta(get_the_ID(), '_yoast_wpseo_redirect', true) !== '') { continue; } $category = get_the_category(); // Only display a post link once, even if it's in multiple categories if ($category[0]->cat_ID == $cat->cat_ID) { $goHtm .= '<li><a href="' . get_permalink() . '">' . get_the_title() . '</a></li>'; } } wp_reset_query(); $goHtm .= "</ul>"; $goHtm .= "</li>"; } $goHtm .= '</ul></div>'; } // ============================================================================== // Custom Post Types foreach (get_post_types(array('public' => true)) as $post_type) { $postsTest = get_posts('post_type=' . $post_type); if (!empty($postsTest)) { $checkSitemap = 'post_types-' . $post_type . '-not_in_sitemap'; if (in_array($post_type, array('post', 'page', 'attachment')) || $checkOptions[$checkSitemap] === true) { continue; } $postType = get_post_type_object($post_type); $postTypeLink = get_post_type_archive_link($postType->name); $goHtm .= '<div id="sitemap_' . str_replace(' ', '', strtolower($postType->labels->name)) . '">'; if (!empty($postTypeLink)) { $goHtm .= '<h3><a href="' . $postTypeLink . '">' . $postType->labels->name . '</a></h3>'; } else { $goHtm .= '<h3>' . $postType->labels->name . '</h3>'; } $goHtm .= '<ul>'; query_posts('post_type=' . $post_type . '&posts_per_page=-1&orderby=title&order=ASC'); while (have_posts()) { the_post(); if (get_post_meta(get_the_ID(), '_yoast_wpseo_meta-robots-noindex', true) === '1' && get_post_meta(get_the_ID(), '_yoast_wpseo_sitemap-include', true) !== 'always' || get_post_meta(get_the_ID(), '_yoast_wpseo_sitemap-include', true) === 'never' || get_post_meta(get_the_ID(), '_yoast_wpseo_redirect', true) !== '') { continue; } $goHtm .= '<li><a href="' . get_permalink() . '">' . get_the_title() . '</a></li>'; } wp_reset_query(); $goHtm .= '</ul></div>'; } } // ============================================================================== // Link To Sitemap if ($options['xml-link'] == 'yes') { $goHtm .= '<div id="sitemap_xml"><h3><a rel="alternate" href="' . site_url() . '/sitemap_index.xml" target="_blank">Sitemap XML</a></h3></div>'; } // ============================================================================== // Add Credits Link if ($options['credits-link'] == 'yes') { $goHtm .= '<div id="credits_link">Sitemap by <a href="https://riseofweb.com/" target="_blank">Rise of the Web</a></div>'; } $goHtm .= '<div class="wpseo_clearRow"></div></div><!-- WP SEO HTML Sitemap Plugin END -->'; return $goHtm; }
function list_authors($optioncount = false, $exclude_admin = true, $show_fullname = false, $hide_empty = true, $feed = '', $feed_image = '') { $args = compact('optioncount', 'exclude_admin', 'show_fullname', 'hide_empty', 'feed', 'feed_image'); return wp_list_authors($args); }
</p> </div> <?php } ?> </div> <!-- end author heading --> <div class="w-row"> <div class="w-col w-col-2 blog-left-column"> <?php dynamic_sidebar("sidebar-left"); ?> <div class="authors-list"> <h3 class="h3-green-header">Post by Author</h3> <?php wp_list_authors($args); ?> </div> </div> <div class="w-col w-col-7"> <?php if (have_posts()) { while (have_posts()) { the_post(); ?> <div class="featured-image-blog-container"><?php if (has_post_thumbnail()) { ?> <a href="<?php
<?php //http://yoast.com/html-sitemap-wordpress/ ?> <h2 itemprop="name"><?php _e('Authors:', 'ItalyStrap'); ?> </h2> <meta itemprop="itemListOrder" content="Descending" /> <ul> <?php wp_list_authors(array('exclude_admin' => false)); ?> </ul> <h2 itemprop="name"><?php _e('Pages:', 'ItalyStrap'); ?> </h2> <meta itemprop="itemListOrder" content="Descending" /> <ul> <?php // Add pages you'd like to exclude in the exclude here wp_list_pages(array('exclude' => '', 'title_li' => '')); ?> </ul> <h2 itemprop="name"><?php _e('Articles:', 'ItalyStrap'); ?> </h2> <meta itemprop="itemListOrder" content="Descending" /> <ul>
/** * This function outputs sitemap-esque columns displaying all pages, * categories, authors, monthly archives, and recent posts. * * @since 1.6 */ function genesis_page_archive_content() { ?> <div class="archive-page"> <h4><?php _e('Pages:', 'genesis'); ?> </h4> <ul> <?php wp_list_pages('title_li='); ?> </ul> <h4><?php _e('Categories:', 'genesis'); ?> </h4> <ul> <?php wp_list_categories('sort_column=name&title_li='); ?> </ul> </div><!-- end .archive-page--> <div class="archive-page"> <h4><?php _e('Authors:', 'genesis'); ?> </h4> <ul> <?php wp_list_authors('exclude_admin=0&optioncount=1'); ?> </ul> <h4><?php _e('Monthly:', 'genesis'); ?> </h4> <ul> <?php wp_get_archives('type=monthly'); ?> </ul> <h4><?php _e('Recent Posts:', 'genesis'); ?> </h4> <ul> <?php wp_get_archives('type=postbypost&limit=100'); ?> </ul> </div><!-- end .archive-page--> <?php }
<section id="blog_goods"> <h1 class="big_title">Blog</h1> <?php //wp_tag_cloud( 'smallest=8&largest=22&orderby=count&order=DESC&number=0' ); ?> <div class="tag_cloud"> <h2>Temas: </h2> <?php ctc('smallest=14&largest=16&unit=px&orderby=count&order=DESC&number=0&minnum=4&format=list'); ?> </div> <div class="tag_cloud"> <h2>Autores: </h2> <ul class="tags"> <?php wp_list_authors('show_fullname=1'); ?> <?php // autores invitados. // get_field('auth-name') & href= search?'auth-name' ?> </ul> </div> <div id="banners" class="contain_ctr"> <?php $ad_query = new WP_Query('pagename=publicidad'); while ($ad_query->have_posts()) { $ad_query->the_post(); $rows = get_field('publicidad'); $rand_keys = array_rand($rows, 2);
function test_wp_list_authors_html() { $expected['html'] = 'bob, paul, zack'; $this->AssertEquals( $expected['html'], wp_list_authors( array( 'echo' => false, 'html' => 0 ) ) ); }
?> </h3> <ul class='xoxo <?php echo $entity; ?> '> <?php switch ($entity) { case 'pages': wp_list_pages(array('title_li' => false)); continue; case 'categories': wp_list_categories(array('show_count' => true, 'use_desc_for_title' => false, 'title_li' => false)); continue; case 'authors': wp_list_authors(array('exclude_admin' => false, 'optioncount' => true, 'title_li' => false)); continue; case 'years': wp_get_archives(array('type' => 'yearly', 'show_post_count' => true)); continue; case 'months': wp_get_archives(array('type' => 'monthly', 'show_post_count' => true)); continue; case 'weeks': wp_get_archives(array('type' => 'weekly', 'show_post_count' => true)); continue; case 'days': wp_get_archives(array('type' => 'daily', 'show_post_count' => true)); continue; case 'tag-cloud': wp_tag_cloud(array('number' => 0));
_e('Pages', 'sento'); ?> :</h3> <ul class="sitemap-pages"> <?php wp_list_pages('title_li='); ?> </ul> <h3 class="page-title"><?php _e('Author(s)', 'sento'); ?> :</h3> <ul class="sitemap-authors"> <?php wp_list_authors('optioncount=1'); ?> </ul> </div> <div class="one_half last"> <h3 class="page-title"><?php _e('Posts', 'sento'); ?> :</h3> <ul class="sitemap-posts"> <?php $args = array('orderby' => 'name', 'pad_counts' => '1'); $cats = get_categories($args); foreach ($cats as $cat) { $loop = new WP_Query('posts_per_page=-1&cat=' . $cat->cat_ID);
} } ?> </ul> </div> <!-- end .sitemap-col --> <div class="sitemap-col<?php echo ' last'; ?> "> <h2><?php esc_html_e('Authors', 'AskIt'); ?> </h2> <ul id="sitemap-authors" ><?php wp_list_authors('show_fullname=1&optioncount=1&exclude_admin=0'); ?> </ul> </div> <!-- end .sitemap-col --> </div> <!-- end #sitemap --> <div class="clear"></div> <?php edit_post_link(esc_html__('Edit this page', 'AskIt')); ?> <div class="clear"></div> </div> </div> <!-- end .entry-content --> </div> <!-- end .entry-top -->
the_title(); ?> </a></li> <?php $counter++; } echo '</ol></div>'; wp_reset_postdata(); } ?> <h2>Our Authors</h2> <div> <ul class="archives"> <?php wp_list_authors('exclude_admin=0&optioncount=1'); ?> </ul> </div> <h2>By Month</h2> <div class="archives"> <p class="archives--small"><?php wp_get_archives('type=monthly&format=custom&after= |'); ?> </p> </div> </main><!-- #content --> <?php
/** * @since 1.2 * @deprecated 2.1 * @deprecated Use wp_list_authors() * @see wp_list_authors() * * @param bool $optioncount * @param bool $exclude_admin * @param bool $show_fullname * @param bool $hide_empty * @param string $feed * @param string $feed_image * @return unknown */ function list_authors($optioncount = false, $exclude_admin = true, $show_fullname = false, $hide_empty = true, $feed = '', $feed_image = '') { _deprecated_function(__FUNCTION__, '2.1', 'wp_list_authors()'); $args = compact('optioncount', 'exclude_admin', 'show_fullname', 'hide_empty', 'feed', 'feed_image'); return wp_list_authors($args); }
/** * Generate an HTML sitemap * * @param array $atts The attributes passed to the shortcode. * * @return string */ function wpseo_sitemap_handler( $atts ) { $atts = shortcode_atts( array( 'authors' => true, 'pages' => true, 'posts' => true, 'archives' => true, ), $atts ); $display_authors = ( $atts['authors'] === 'no' ) ? false : true; $display_pages = ( $atts['pages'] === 'no' ) ? false : true; $display_posts = ( $atts['posts'] === 'no' ) ? false : true; $display_archives = ( $atts['archives'] === 'no' ) ? false : true; $options = WPSEO_Options::get_all(); /* Delete the transient if any of these are no @todo [JRF => whomever] have a good look at this, as this would basically mean that if any of these are no, we'd never use the transient and would always build again from scratch which is very inefficient Suggestion: have several different transients based on the variables chosen */ if ( $display_authors === false || $display_pages === false || $display_posts === false ) { delete_transient( 'html-sitemap' ); } // Get any existing copy of our transient data if ( false !== ( $output = get_transient( 'html-sitemap' ) ) ) { // $output .= 'CACHE'; // debug // return $output; } $output = ''; // create author list if ( $display_authors ) { // use echo => false b/c shortcode format screws up $author_list = wp_list_authors( array( 'exclude_admin' => false, 'echo' => false, ) ); if ( $author_list !== '' ) { $output .= ' <h2 id="authors">' . __( 'Authors', 'wordpress-seo' ) . '</h2> <ul> ' . $author_list . ' </ul>'; } } // create page list if ( $display_pages ) { // Some query magic to retrieve all pages that should be excluded, while preventing noindex pages that are set to // "always" include in HTML sitemap from being excluded. // @todo [JRF => whomever] check query efficiency using EXPLAIN $exclude_query = "SELECT DISTINCT( post_id ) FROM {$GLOBALS['wpdb']->postmeta} WHERE ( ( meta_key = '" . WPSEO_Meta::$meta_prefix . "sitemap-html-include' AND meta_value = 'never' ) OR ( meta_key = '" . WPSEO_Meta::$meta_prefix . "meta-robots-noindex' AND meta_value = '1' ) ) AND post_id NOT IN ( SELECT pm2.post_id FROM {$GLOBALS['wpdb']->postmeta} pm2 WHERE pm2.meta_key = '" . WPSEO_Meta::$meta_prefix . "sitemap-html-include' AND pm2.meta_value = 'always') ORDER BY post_id ASC"; $excluded_pages = $GLOBALS['wpdb']->get_results( $exclude_query ); $exclude = array(); if ( is_array( $excluded_pages ) && $excluded_pages !== array() ) { foreach ( $excluded_pages as $page ) { $exclude[] = $page->post_id; } } unset( $excluded_pages, $page ); /** * This filter allows excluding more pages should you wish to from the HTML sitemap. */ $exclude = implode( ',', apply_filters( 'wpseo_html_sitemap_page_exclude', $exclude ) ); $page_list = wp_list_pages( array( 'exclude' => $exclude, 'title_li' => '', 'echo' => false, ) ); if ( $page_list !== '' ) { $output .= ' <h2 id="pages">' . __( 'Pages', 'wordpress-seo' ) . '</h2> <ul> ' . $page_list . ' </ul>'; } } // create post list if ( $display_posts ) { // Add categories you'd like to exclude in the exclude here // possibly have this controlled by shortcode params $cats_map = ''; $cats = get_categories( 'exclude=' ); if ( is_array( $cats ) && $cats !== array() ) { foreach ( $cats as $cat ) { $args = array( 'post_type' => 'post', 'post_status' => 'publish', 'posts_per_page' => -1, 'cat' => $cat->cat_ID, 'meta_query' => array( 'relation' => 'OR', // include if this key doesn't exists array( 'key' => WPSEO_Meta::$meta_prefix . 'meta-robots-noindex', 'value' => 'needs-a-value-anyway', // This is ignored, but is necessary... 'compare' => 'NOT EXISTS', ), // OR if key does exists include if it is not 1 array( 'key' => WPSEO_Meta::$meta_prefix . 'meta-robots-noindex', 'value' => '1', 'compare' => '!=', ), // OR this key overrides it array( 'key' => WPSEO_Meta::$meta_prefix . 'sitemap-html-include', 'value' => 'always', 'compare' => '=', ), ), ); $posts = get_posts( $args ); if ( is_array( $posts ) && $posts !== array() ) { $posts_in_cat = ''; foreach ( $posts as $post ) { $category = get_the_category( $post->ID ); // Only display a post link once, even if it's in multiple categories if ( $category[0]->cat_ID == $cat->cat_ID ) { $posts_in_cat .= ' <li><a href="' . esc_url( get_permalink( $post->ID ) ) . '">' . get_the_title( $post->ID ) . '</a></li>'; } } if ( $posts_in_cat !== '' ) { $cats_map .= ' <li> <h3>' . $cat->cat_name . '</h3> <ul> ' . $posts_in_cat . ' </ul> </li>'; } } unset( $posts, $post, $posts_in_cat, $category ); } } if ( $cats_map !== '' ) { $output .= ' <h2 id="posts">' . __( 'Posts', 'wordpress-seo' ) . '</h2> <ul> ' . $cats_map . ' </ul>'; } unset( $cats_map, $cats, $cat, $args ); } // get all public non-builtin post types $args = array( 'public' => true, '_builtin' => false, ); $post_types = get_post_types( $args, 'object' ); if ( is_array( $post_types ) && $post_types !== array() ) { // create an noindex array of post types and taxonomies $noindex = array(); foreach ( $options as $key => $value ) { if ( strpos( $key, 'noindex-' ) === 0 && $value === true ) { $noindex[] = $key; } } $archives = ''; // create custom post type list foreach ( $post_types as $post_type ) { if ( is_object( $post_type ) && ! in_array( 'noindex-' . $post_type->name, $noindex ) ) { $output .= ' <h2 id="' . $post_type->name . '">' . esc_html( $post_type->label ) . '</h2> <ul> ' . create_type_sitemap_template( $post_type ) . ' </ul>'; } // create archives list if ( $display_archives ) { if ( is_object( $post_type ) && $post_type->has_archive && ! in_array( 'noindex-ptarchive-' . $post_type->name, $noindex ) ) { $archives .= '<a href="' . esc_url( get_post_type_archive_link( $post_type->name ) ) . '">' . esc_html( $post_type->labels->name ) . '</a>'; $archives .= create_type_sitemap_template( $post_type ); } } } if ( $archives !== '' ) { $output .= ' <h2 id="archives">' . __( 'Archives', 'wordpress-seo' ) . '</h2> <ul> ' . $archives .' </ul>'; } } set_transient( 'html-sitemap', $output, 60 ); return $output; }