本文整理汇总了PHP中wp_list_authors函数的典型用法代码示例。如果您正苦于以下问题:PHP wp_list_authors函数的具体用法?PHP wp_list_authors怎么用?PHP wp_list_authors使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了wp_list_authors函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: widget
/**
* 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;
}
示例2: 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;
}
示例3: authors_block
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;
}
示例4: genesis_page_archive_content
/**
* 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();
}
示例5: widget_author_info_card
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;
}
示例6: Grafik_Functions_Shortcode_BlogAuthors
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>';
}
示例7: widget_sidebar
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
}
示例8: sub_author_listing
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;
}
示例9: dt_sitemap_shortcode
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;
}
示例10: widget
/**
* 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;
}
示例11: 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;
}
示例12: widget_authors
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;
}
示例13: shortcode_list_authors
/**
* 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);
}
示例14: get_tag_link
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
示例15: wp_get_archives
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>