コード例 #1
0
ファイル: author.php プロジェクト: boonebgorges/wp
 function test_get_the_author_posts()
 {
     // Test with no global post, result should be 0 because no author is found
     $this->assertEquals(0, get_the_author_posts());
     $GLOBALS['post'] = $this->post_id;
     $this->assertEquals(1, get_the_author_posts());
 }
コード例 #2
0
function wp_about_author_display($for_feed = false)
{
    global $post;
    $wp_about_author_settings = array();
    $wp_about_author_settings = get_option('wp_about_author_settings');
    $wp_about_author_content = "";
    $wp_about_author_links = "";
    $wp_about_author_social = "";
    $wp_about_author_author_pic = "";
    $wp_about_author_author = array();
    $wp_about_author_author['name'] = get_the_author();
    $wp_about_author_author['description'] = get_the_author_meta('description');
    $wp_about_author_author['website'] = get_the_author_meta('url');
    $wp_about_author_author['posts'] = (int) get_the_author_posts();
    $wp_about_author_author['posts_url'] = get_author_posts_url(get_the_author_meta('ID'));
    $wp_about_author_author_pic = get_avatar(get_the_author_meta('email'), '100');
    // About Author Title
    $wp_about_author_content .= "<h3><a href='" . $wp_about_author_author['posts_url'] . "' title='" . $wp_about_author_author['name'] . "'>" . apply_filters('wp_about_author_name', $wp_about_author_author['name']) . "</a></h3>";
    // About Author Description
    $wp_about_author_content .= "<p>" . apply_filters('wp_about_author_description', $wp_about_author_author['description']) . "</p>";
    // About Author Links
    if (!empty($wp_about_author_author['posts_url'])) {
        $wp_about_author_links .= "<a href='" . $wp_about_author_author['posts_url'] . "' title='More posts by " . $wp_about_author_author['name'] . "'>" . apply_filters('wp_about_author_more_posts', "More Posts") . "</a> ";
    }
    if (!empty($wp_about_author_author['website'])) {
        if ($wp_about_author_links != "") {
            $wp_about_author_links .= apply_filters('wp_about_author_separator', " - ");
        }
        $wp_about_author_links .= "<a href='" . $wp_about_author_author['website'] . "' title='" . $wp_about_author_author['name'] . "'>" . apply_filters('wp_about_author_website', "Website") . "</a> ";
    }
    // About Author Social
    $wp_about_author_social .= wp_about_author_get_social_links($wp_about_author_settings);
    if (isset($wp_about_author_settings['wp_author_social_images']) && $wp_about_author_settings['wp_author_social_images']) {
        $wp_about_author_content .= "<p>" . $wp_about_author_links . "</p>";
        if ($wp_about_author_social != "") {
            $wp_about_author_content .= '<p class="wpa-nomargin">' . apply_filters('wp_about_author_follow_me', "Follow Me:") . '<br />' . $wp_about_author_social . '</p>';
        }
    } else {
        $wp_about_author_content .= "<p class='wpa-nomargin'>";
        $wp_about_author_content .= $wp_about_author_links;
        if ($wp_about_author_social != "") {
            $wp_about_author_content .= apply_filters('wp_about_author_separator', " - ") . $wp_about_author_social;
        }
        $wp_about_author_content .= "</p>";
    }
    // Create output
    $return_content = '';
    // Allow filters to create new templates for output
    if (!$for_feed) {
        $return_content = apply_filters('wp_about_author_template', '<div class="wp-about-author-containter-%%bordertype%%" style="background-color:%%borderbg%%;"><div class="wp-about-author-pic">%%authorpic%%</div><div class="wp-about-author-text">%%content%%</div></div>');
    } else {
        $return_content = apply_filters('wp_about_author_feed_template', '<p><div style="float:left; text-align:left;>%%authorpic%%</div>%%content%%</p>');
    }
    $replace_array = array('%%bordertype%%' => $wp_about_author_settings['wp_author_alert_border'], '%%borderbg%%' => $wp_about_author_settings['wp_author_alert_bg'], '%%authorpic%%' => $wp_about_author_author_pic, '%%content%%' => $wp_about_author_content);
    foreach ($replace_array as $search => $replace) {
        $return_content = str_replace($search, $replace, $return_content);
    }
    return apply_filters('wp_about_author_display', $return_content);
}
コード例 #3
0
 /**
  * @ticket 30904
  */
 function test_get_the_author_posts_with_custom_post_type()
 {
     register_post_type('wptests_pt');
     $cpt_ids = self::factory()->post->create_many(2, array('post_author' => $this->author_id, 'post_type' => 'wptests_pt'));
     $GLOBALS['post'] = $cpt_ids[0];
     $this->assertEquals(2, get_the_author_posts());
     _unregister_post_type('wptests_pt');
 }
コード例 #4
0
function wp_about_author_display($for_feed = false)
{
    global $post;
    $wp_about_author_settings = array();
    $wp_about_author_settings = get_option('wp_about_author_settings');
    $wp_about_author_content = "";
    $wp_about_author_author_pic = "";
    $wp_about_author_author = array();
    $wp_about_author_author['name'] = get_the_author();
    $wp_about_author_author['description'] = get_the_author_meta('description');
    $wp_about_author_author['twitter'] = get_the_author_meta('twitter');
    $wp_about_author_author['facebook'] = get_the_author_meta('facebook');
    $wp_about_author_author['website'] = get_the_author_meta('url');
    $wp_about_author_author['posts'] = (int) get_the_author_posts();
    $wp_about_author_author['posts_url'] = get_author_posts_url(get_the_author_meta('ID'));
    $wp_about_author_author_pic = get_avatar(get_the_author_email(), '100');
    $wp_about_author_content .= "<h3><a href='" . $wp_about_author_author['posts_url'] . "' title='" . $wp_about_author_author['name'] . "'>" . $wp_about_author_author['name'] . "</a></h3>";
    $wp_about_author_content .= "<p>" . $wp_about_author_author['description'] . "</p>";
    $wp_about_author_link = '';
    if (!empty($wp_about_author_author['website']) || !empty($wp_about_author_author['twitter']) || !empty($wp_about_author_author['facebook'])) {
        $wp_about_author_content .= "<p>";
        if (!empty($wp_about_author_author['website'])) {
            $wp_about_author_link .= "<a href='" . $wp_about_author_author['website'] . "' title='" . $wp_about_author_author['name'] . "'>Website</a> ";
        }
        if (!empty($wp_about_author_author['twitter'])) {
            if ($wp_about_author_link != "") {
                $wp_about_author_link .= "- ";
            }
            $wp_about_author_link .= "<a href='" . $wp_about_author_author['twitter'] . "' title='" . $wp_about_author_author['name'] . "on Twitter'>Twitter</a> ";
        }
        if (!empty($wp_about_author_author['facebook'])) {
            if ($wp_about_author_link != "") {
                $wp_about_author_link .= "- ";
            }
            $wp_about_author_link .= "<a href='" . $wp_about_author_author['facebook'] . "' title='" . $wp_about_author_author['name'] . " on Facebook'>Facebook</a> ";
        }
        if (!empty($wp_about_author_author['posts_url'])) {
            if ($wp_about_author_link != "") {
                $wp_about_author_link .= "- ";
            }
            $wp_about_author_link .= "<a href='" . $wp_about_author_author['posts_url'] . "' title='More posts by " . $wp_about_author_author['name'] . "'>More Posts</a> ";
        }
        $wp_about_author_content .= $wp_about_author_link;
        $wp_about_author_content .= "</p>";
    }
    if (!$for_feed) {
        return '<div class="wp-about-author-containter-' . $wp_about_author_settings['wp_author_alert_border'] . '" style="background-color:' . $wp_about_author_settings['wp_author_alert_bg'] . ';"><div class="wp-about-author-pic">' . $wp_about_author_author_pic . '</div><div class="wp-about-author-text">' . $wp_about_author_content . '</div></div>';
    } else {
        return '<p><div style="float:left; text-align:left;>' . $wp_about_author_author_pic . '</div>' . $wp_about_author_content . '</p>';
    }
}
コード例 #5
0
ファイル: theme-shortcodes.php プロジェクト: rzb/boletos2
/**
 * Returns current user information
 * Example of use:
 * [mantra-author display='attr'] where attr can be author / description / login / first-name / last-name / nickname / id / url / link / aim / yim / posts / posts-url
 * Attributes:
 * "display" - optional
 */
function mantra_the_author_fn($attr)
{
    global $mantra_social_networks;
    $id = get_the_author_meta('ID');
    if ($id) {
        if (isset($attr['display'])) {
            $display = $attr['display'];
            switch ($display) {
                case 'author':
                    return get_the_author();
                case 'description':
                    return get_the_author_meta('description', $id);
                case 'login':
                    return get_the_author_meta('user_login', $id);
                case 'first-name':
                    return get_the_author_meta('first_name', $id);
                case 'last-name':
                    return get_the_author_meta('last_name', $id);
                case 'nickname':
                    return get_the_author_meta('nickname', $id);
                case 'id':
                    return $id;
                case 'url':
                    return get_the_author_meta('user_url', $id);
                case 'email':
                    return get_the_author_meta('user_email', $id);
                case 'link':
                    if (get_the_author_meta('user_url', $id)) {
                        return '<a href="' . get_the_author_meta('user_url', $id) . '" title="' . esc_attr(get_the_author()) . '" rel="external">' . get_the_author() . '</a>';
                    } else {
                        return get_the_author();
                    }
                case 'aim':
                    return get_the_author_meta('aim', $id);
                case 'yim':
                    return get_the_author_meta('yim', $id);
                case 'posts':
                    return get_the_author_posts();
                case 'posts-url':
                    return get_author_posts_url(get_the_author_meta('ID'));
            }
        } else {
            return get_the_author();
        }
    }
}
コード例 #6
0
function swift_np2_authors_mosaic()
{
    $args = array('orderby' => 'post_count', 'order' => '', 'number' => 9, 'optioncount' => false, 'exclude_admin' => true, 'show_fullname' => false, 'hide_empty' => true, 'echo' => true, 'feed' => '', 'feed_image' => '', 'feed_type' => '', 'style' => 'list', 'html' => true);
    // The Query
    $user_query = new WP_User_Query($args);
    // User Loop
    if (!empty($user_query->results)) {
        $out = '<p class="section-title">Top authors</p><ul class="mosaic">';
        foreach ($user_query->results as $user) {
            //var_dump( $user);
            $out .= '<li><a href="' . esc_url(get_author_posts_url($user->ID)) . '" rel="author">' . get_avatar($user->ID, 115) . '</a>';
            $out .= '<div class="tooltip">About <strong>' . $user->display_name . '</strong><br />';
            $out .= get_the_author_meta('description', $user->ID) . '<br />';
            $out .= $user->display_name . ' ' . sprintf(__('has written %d articles so far.', 'swift'), '<strong>' . get_the_author_posts($user->ID) . '</strong>');
            $out .= '<br /><a href="' . esc_url(get_author_posts_url($user->ID)) . '" rel="author">' . __('Read them all', 'swift') . '</a>';
            $out .= '</div></li>';
        }
        $out .= '</ul>';
    } else {
        echo 'No users found.';
    }
    echo $out;
}
コード例 #7
0
/**
 * Default post meta
 *
 * @uses $rtp_post_comments Post Comments DB array
 * @uses $post Post Data
 * @param string $placement Specify the position of the post meta (top/bottom)
 *
 * @since rtPanel 2.0
 */
function rtp_default_post_meta($placement = 'top')
{
    if ('post' == get_post_type() && !rtp_is_bbPress()) {
        global $post, $rtp_post_comments;
        $position = 'bottom' == $placement ? 'l' : 'u';
        // l = Lower/Bottom , u = Upper/Top
        if (rtp_has_postmeta($position)) {
            if ($position == 'l') {
                echo '<footer class="post-footer">';
            }
            ?>

			<div class="clearfix post-meta post-meta-<?php 
            echo esc_attr($placement);
            ?>
"><?php 
            if ('bottom' == $placement) {
                rtp_hook_begin_post_meta_bottom();
            } else {
                rtp_hook_begin_post_meta_top();
            }
            // Author Link
            if ($rtp_post_comments['post_author_' . $position] || $rtp_post_comments['post_date_' . $position]) {
                if ($rtp_post_comments['post_author_' . $position]) {
                    printf(__('<span class="rtp-post-author-prefix">By</span> <span class="vcard author">%s</span>', 'rtPanel'), !$rtp_post_comments['author_link_' . $position] ? get_the_author() . ($rtp_post_comments['author_count_' . $position] ? '(' . get_the_author_posts() . ')' : '') : sprintf(__('<a class="fn" href="%1$s" title="%2$s">%3$s</a>', 'rtPanel'), get_author_posts_url(get_the_author_meta('ID'), get_the_author_meta('user_nicename')), esc_attr(sprintf(__('Posts by %s', 'rtPanel'), get_the_author())), get_the_author()) . ($rtp_post_comments['author_count_' . $position] ? '(' . get_the_author_posts() . ')' : ''));
                }
                echo $rtp_post_comments['post_author_' . $position] && $rtp_post_comments['post_date_' . $position] ? ' ' : '';
                if ($rtp_post_comments['post_date_' . $position]) {
                    printf(__('<span class="rtp-meta-separator">&middot;</span> <time class="published date updated" datetime="%s">%s</time>', 'rtPanel'), get_the_date('c'), get_the_time($rtp_post_comments['post_date_format_' . $position]));
                }
            }
            // Post Categories
            echo get_the_category_list() && $rtp_post_comments['post_category_' . $position] ? ' <span class="rtp-meta-separator">&middot;</span> ' . get_the_category_list(', ') . '' : '';
            // Comment Count
            rtp_default_comment_count();
            // Post Tags
            echo get_the_tag_list() && $rtp_post_comments['post_tags_' . $position] ? '<p class="post-tags">' . get_the_tag_list(__('Tagged', 'rtPanel') . ': <span>', ', ', '</span>') . '</p>' : '';
            // Post Custom Taxonomies
            $args = array('_builtin' => false);
            $taxonomies = get_taxonomies($args, 'objects');
            foreach ($taxonomies as $key => $taxonomy) {
                get_the_terms($post->ID, $key) && isset($rtp_post_comments['post_' . $key . '_' . $position]) && $rtp_post_comments['post_' . $key . '_' . $position] ? the_terms($post->ID, $key, '<span class="post-custom-tax post-' . $key . '">' . $taxonomy->labels->singular_name . ': ', ', ', '</span>') : '';
            }
            if ('bottom' == $placement) {
                rtp_hook_end_post_meta_bottom();
            } else {
                rtp_hook_end_post_meta_top();
            }
            ?>

			</div><!-- .post-meta --><?php 
            if ($position == 'l') {
                echo '</footer>';
            }
        }
    } elseif (!rtp_is_bbPress()) {
        if (get_edit_post_link() && 'top' == $placement) {
            ?>
			<div class="post-meta post-meta-top"><?php 
            rtp_hook_end_post_meta_top();
            ?>
</div><?php 
        }
    }
}
コード例 #8
0
							<div id="author-link">
								<?php 
            if (get_the_author_posts() > 1) {
                // if a user has only one post, don't link to their all posts page.
                ?>
									<a href="<?php 
                echo get_author_posts_url(get_the_author_meta('ID'));
                ?>
">
								
									<?php 
                echo "View all posts by " . get_the_author();
                ?>
								<?php 
            }
            if (get_the_author_posts() > 1 and get_the_author_meta('user_url')) {
                ?>
									</a><span> | </span>
								<?php 
            }
            if (get_the_author_meta('user_url')) {
                // if the user webpage link is filled out, display it.
                ?>
									<a href="<?php 
                echo get_the_author_meta('user_url');
                ?>
"><?php 
                echo "Visit " . trim(get_the_author_meta('user_url'), 'http://');
                ?>
</a>
								<?php 
コード例 #9
0
 /**
  * [the_author_posts] shortcode
  * 
  * @since 0.1
  * @author Ryan Hellyer <*****@*****.**>
  * @return string
  */
 public function the_author_posts_shortcode()
 {
     return get_the_author_posts();
 }
コード例 #10
0
ファイル: author-off.php プロジェクト: jul6art/graph-it
?>
</h1> 
    <h2>A propos de l’auteur</h2> 
    <p class="auteur"><?php 
the_author_meta('description');
?>
</p> 
    <h2>Son profil :</h2> 
    <p> 
        <strong>Son eMail</strong> : <?php 
echo the_author_meta('user_email');
?>
.<br /> 
        <strong>Son site web</strong> : <?php 
echo the_author_meta('user_url');
?>
.<br /> 
    </p> 
    <p><?php 
echo get_the_author();
?>
 a écrit <?php 
echo get_the_author_posts();
?>
 articles dans ce site.</p> 
</main> 
  
<?php 
get_footer();
?>
 <!-- Appel au template du pied de page-->
コード例 #11
0
ファイル: author-box.php プロジェクト: FrederiqueGame/simone
<div class="author-info">

    <div class="author-avatar">
            <?php 
echo get_avatar(get_the_author_meta('user_email'), 96);
?>
    </div><!-- .author-avatar -->
    <div class="author-meta">
        <h2 class="author-title"><?php 
printf(__('About %s', 'simone'), get_the_author());
?>
</h2>
        <div class="share-and-more">
            <?php 
// Change language depending on number of posts
$posts_posted = get_the_author_posts();
if ($posts_posted == 1) {
    printf(__('One article and counting. ', 'simone'));
} else {
    printf(__('%s articles and counting. ', 'simone'), the_author_posts());
}
$author_firstname = get_the_author_meta('first_name');
// Check if social media info is collected in user profile
// Usually handled by a plugin like WordPress SEO by Yoast
$author_twitter = get_the_author_meta('twitter');
$author_googleplus = get_the_author_meta('googleplus');
$author_facebook = get_the_author_meta('facebook');
if ($author_twitter || $author_googleplus || $author_facebook) {
    echo '<div class="author-social-media">';
    printf(__('Follow %s on social media: ', 'simone'), get_the_author_meta('first_name'));
    if ($author_twitter) {
コード例 #12
0
    echo $curauth->user_description . '<br />';
}
?>
                <strong><?php 
_e('Website:', 'swift');
?>
 </strong> <a
                    href="<?php 
echo $curauth->user_url;
?>
"><?php 
echo $curauth->user_url;
?>
                </a><br/>
                <?php 
printf(get_the_author_posts() > 0 ? _n('%1$s has written %2$s article so far, you can find it below.', '%1$s has written %2$s articles so far, you can find them below.', get_the_author_posts(), 'swift') : __('%1$s has written no articles so far.', 'swift'), $curauth->nickname, '<strong>' . get_the_author_posts() . '</strong>');
?>
                <br/>
            </div>
        </div>
        <div id="<?php 
echo $content_id;
?>
" class="div-content clearfix">
            <div class="gutter-sizer"></div>

            <?php 
if (have_posts()) {
    ?>
                <?php 
    if ($swift_design_options['blog_or_mag_archives'] == 'list') {
コード例 #13
0
        ?>
				<div class="archive-header" 
					itemprop="mainEntity" itemscope itemtype="https://schema.org/Person">
					<h1 rel="tag" itemprop="name"><?php 
        the_author_posts_link();
        ?>
</h1>
					<div class="author-meta">
						<div class="entry">
							<div class="author-photo-cont">
								<a href="<?php 
        echo get_author_posts_url($user_id);
        ?>
" class="author-nrposts">
									<?php 
        echo number_format_i18n(get_the_author_posts());
        ?>
								</a>
								<a href="<?php 
        echo get_author_posts_url($user_id);
        ?>
" class="author-photo-anchor">
									<?php 
        $wp_avatar_profile = get_user_meta($user_id, 'wp_avatar_profile', true);
        $wp_fb_profile = get_user_meta($user_id, 'wp_fb_profile', true);
        $wp_avatar_capability = get_option('wp_avatar_capability', 'read');
        $size = '300';
        $atts = array('extra_attr' => 'itemprop="image"');
        if (user_can($user_id, $wp_avatar_capability)) {
            if ('wp-facebook' == $wp_avatar_profile && !empty($wp_fb_profile)) {
                $fb = 'https://graph.facebook.com/' . $wp_fb_profile . '/picture?width=' . $size . '&height=' . $size;
コード例 #14
0
ファイル: bab_manu.php プロジェクト: mkrdip/better-author-bio
function bab_manual()
{
    if (is_single()) {
        $bab_showauttxt = get_option('bab_showauttxt');
        $bab_auttxt1 = get_option('bab_auttxt1');
        $bab_auttxt2 = get_option('bab_auttxt2');
        $bab_showautbio = get_option('bab_showautbio');
        $bab_showautintro = get_option('bab_showautintro');
        $bab_showautgra = get_option('bab_showautgra');
        $author = array();
        $author['name'] = get_the_author();
        $author['twitter'] = get_the_author_meta('twitter');
        $author['facebook'] = get_the_author_meta('facebook');
        $author['gplus'] = get_the_author_meta('gplus');
        $author['posts'] = (int) get_the_author_posts();
        $email = get_the_author_meta('email');
        ob_start();
        ?>
			<div id="better-author-bio-div" style="background:#F7F7F7; margin:20px 0px 0px 0px; padding:10px 0; border:1px solid #E6E6E6; overflow:hidden; width:100%;" >
				<div class="better-author-bio-div-info">
				        <?php 
        if ($bab_showautgra == 'y') {
            ?>
					<?php 
            echo bab_gravatar($email);
            ?>
					<?php 
        }
        ?>
					<h4 style"margin:0 0 4px 90px; padding:0;" ><?php 
        printf(esc_attr__('%s %s'), $bab_showautintro, get_the_author());
        ?>
</h4>
					
					<?php 
        if ($bab_showauttxt == 'y') {
            ?>
					<p style="margin:0 0 0 90px; padding:0;" class="better-author-bio-div-text"><?php 
            echo esc_attr(sprintf(__ngettext('%s %s %d %s', '%s %s %d %s', $author['posts'], $bab_auttxt1, $bab_auttxt2, 'better-author-bio-div'), get_the_author_firstname() . ' ' . get_the_author_lastname(), $bab_auttxt1, $author['posts'], $bab_auttxt2));
            ?>
.</p>
					<?php 
        } else {
            echo "<br />";
        }
        ?>
					<?php 
        if ($bab_showautbio == 'y') {
            ?>
					<p style="margin:0 0 0 90px; padding:0;" class="better-author-bio-div-meta"><?php 
            echo get_the_author_meta('description');
            ?>
</p>
					<?php 
        } else {
            echo "<br />";
        }
        ?>
					<ul style="overflow:hidden; margin:0 0 0 90px; padding:0;" >
						<li style="list-style-type:none; float:left; margin:8px 6px 0 0; padding:0 0 0 6px; line-height:120%; border-left:1px solid #ccc;" class="first" ><a href="<?php 
        echo get_author_posts_url(get_the_author_meta('ID'));
        ?>
">
									<?php 
        printf(__('View all posts by %s <span class="meta-nav">&rarr;</span>'), get_the_author());
        ?>
								</a></li>
						<li style="list-style-type:none; float:left; margin:8px 6px 0 0; padding:0 0 0 6px; line-height:120%; border-left:1px solid #ccc;" class="first" ><a href="<?php 
        echo get_the_author_meta('url');
        ?>
" title="<?php 
        echo esc_attr(sprintf(__('Read %s&#8217;s blog', 'better-author-bio-div'), $author['name']));
        ?>
"><?php 
        echo __("Blog");
        ?>
</a></li>
						<?php 
        if (!empty($author['twitter'])) {
            ?>
						<li style="list-style-type:none; float:left; margin:8px 6px 0 0; padding:0 0 0 6px; line-height:120%; border-left:1px solid #ccc;" class="first" ><a href="<?php 
            echo $author['twitter'];
            ?>
" title="<?php 
            echo esc_attr(sprintf(__('Follow %s on Twitter', 'better-author-bio-div'), $author['name']));
            ?>
" rel="external">Twitter</a></li>
						<?php 
        }
        ?>
						<?php 
        if (!empty($author['facebook'])) {
            ?>
						<li style="list-style-type:none; float:left; margin:8px 6px 0 0; padding:0 0 0 6px; line-height:120%; border-left:1px solid #ccc;" class="first" ><a href="<?php 
            echo $author['facebook'];
            ?>
" title="<?php 
            echo esc_attr(sprintf(__('Be %s&#8217;s friend on Facebook', 'better-author-bio-div'), $author['name']));
            ?>
" rel="external">Facebook</a></li><?php 
        }
        ?>
                        <?php 
        if (!empty($author['gplus'])) {
            ?>
<li style="list-style-type:none; float:left; margin:8px 6px 0 0; padding:0 0 0 6px; line-height:120%; border-left:1px solid #ccc;" class="first" ><a href="<?php 
            echo $author['gplus'];
            ?>
" rel="me" title="<?php 
            echo esc_attr(sprintf(__('Add %s in your circle', 'better-author-bio-div'), $author['name']));
            ?>
" rel="external">Google+</a></li>
						<?php 
        }
        ?>
                          <?php 
        if (!empty($author['lknin'])) {
            ?>
<li><a href="<?php 
            echo $author['lnkin'];
            ?>
"  title="<?php 
            echo esc_attr(sprintf(__('Connect with %s', 'better-author-bio-div'), $author['name']));
            ?>
" rel="external">LinkedIn</a></li>
						<?php 
        }
        ?>
					</ul>
				</div>
			</div>
<?php 
    }
    $bab_bio = ob_get_clean();
    echo $bab_bio;
}
コード例 #15
0
 /**
  * Returns page subheading
  *
  * @since 3.0.0
  */
 private function get_page_subheading()
 {
     // Subheading is NULL by default
     $subheading = NULL;
     // Posts & Pages
     if ($meta = get_post_meta($this->post_id, 'wpex_post_subheading', true)) {
         $subheading = $meta;
     } elseif (is_search()) {
         $subheading = __('You searched for:', 'wpex') . ' &quot;' . esc_html(get_search_query(false)) . '&quot;';
     } elseif (is_category()) {
         if ('under_title' == wpex_get_mod('category_description_position', 'under_title')) {
             $subheading = term_description();
         }
     } elseif (is_author()) {
         $subheading = __('This author has written', 'wpex') . ' ' . get_the_author_posts() . ' ' . __('articles', 'wpex');
     } elseif (is_tax() && !wpex_has_term_description_above_loop()) {
         $subheading = term_description();
     }
     // Apply filters and return
     return apply_filters('wpex_post_subheading', $subheading);
 }
コード例 #16
0
ファイル: shortcodes.php プロジェクト: pemiu01/wppaintbrush
/**
 * [the_author_posts] shortcode
 * @since 0.1
*/
function pixopoint_the_author_posts_shortcode()
{
    return get_the_author_posts();
}
コード例 #17
0
ファイル: single.php プロジェクト: javalidigital/tecnigrav
            ?>
: <?php 
            the_author_link();
            ?>
</h3>
				<p><?php 
            echo get_the_author_meta('description');
            ?>
</p>
			</div>
			<?php 
            if (get_the_author_meta('facebook') != '' | get_the_author_meta('twitter') != '' | get_the_author_meta('googleplus') != '' | get_the_author_meta('instagram') != '' | get_the_author_meta('rss') != '') {
                ?>
				<div class="social01">
					<?php 
                if (get_the_author_posts() > 1) {
                    ?>
						<p class="articles"><?php 
                    esc_attr_e('More articles', 'converio');
                    ?>
 <?php 
                    esc_attr_e('by', 'converio');
                    ?>
 <?php 
                    the_author_posts_link();
                    ?>
</p>
					<?php 
                }
                ?>
					<p><?php 
コード例 #18
0
						<?php 
            echo get_avatar(get_the_author_meta('user_email'), 120);
            ?>
						<h2><?php 
            the_author();
            ?>
</h2>
						<p><?php 
            echo get_the_author_meta('description');
            ?>
</p>
						<?php 
            workspace_author_links();
            ?>
						<span class="meta"><?php 
            printf(_n('1 post', '%s posts', get_the_author_posts()), get_the_author_posts());
            ?>
</span>
						<div class="clear"></div>
					</section>
					<?php 
        }
        ?>
					
					<article>
						<div class="thumb">
							<a href="<?php 
        the_permalink();
        ?>
">
								<?php 
コード例 #19
0
"><?php 
    echo $auth->user_url;
    ?>
</a>
                        <?php 
}
?>
                    </div>
                    <div class="content">
                        <?php 
echo $auth->description;
?>
                    </div>
                    <span class="posts">
                        <?php 
echo sprintf(__('%d posts', 'trendy'), get_the_author_posts());
?>
                        <br/>
                        <i class="icon-angle-down"></i>
                    </span>
                </div>
            </div>

            <div class="col-sm-8">
                <div class="left-container text-editor">
                    <?php 
global $query_string;
echo '<span class="query_parameters" data-parameters="' . $query_string . '" style="display: none"></span>';
while (have_posts()) {
    the_post();
    global $post;
コード例 #20
0
ファイル: author.php プロジェクト: jonmircha/iconos29
	<article class="item  title-template">
		<h1>
			El archivo <em>author.php</em> es el archivo que toma por defecto WordPress para mostrar la página de perfil del autor (usuario) actual.
		</h1>
	</article>	
';
$template_author = '
	<ul class="item  author-info">
		<li>Autor: <b>%s</b></li>
		<li>ID Autor: <b>%s</b></li>
		<li>Correo: <b>%s</b></li>
		<li>Login: <b>%s</b></li>
		<li>Password: <b>%s</b></li>
		<li>Nicename: <b>%s</b></li>
		<li>URL Autor: <b>%s</b></li>
		<li>URL Página Autor: <b>%s</b></li>
		<li>Fecha y Hora de Registro: <b>%s</b></li>
		<li>Rol: <b>%s</b></li
		<li>Nombre para mostrar: <b>%s</b></li>
		<li>Alias: <b>%s</b></li>
		<li>Nombre: <b>%s</b></li>
		<li>Apellido: <b>%s</b></li>
		<li>Descripción: <b>%s</b></li>
		<li>Número de Publicaciones: <b>%s</b></li>
		<li>Avatar: %s</li>
	</ul>
';
printf($template_author, get_the_author(), get_the_author_id(), get_the_author_meta('user_email'), get_the_author_meta('user_login'), get_the_author_meta('user_pass'), get_the_author_meta('user_nicename'), get_the_author_meta('user_url'), get_author_posts_url(get_the_author_id()), get_the_author_meta('user_registered'), get_the_author_meta('roles')[0], get_the_author_meta('display_name'), get_the_author_meta('nickname'), get_the_author_meta('first_name'), get_the_author_meta('last_name'), get_the_author_meta('description'), get_the_author_posts(), get_avatar(get_the_author_id(), 50));
get_template_part('content');
get_sidebar();
get_footer();
コード例 #21
0
ファイル: tag.php プロジェクト: aliaspseudonym/mantra-child
				<div class="feat-image">
					<?php 
        the_post_thumbnail('medium');
        ?>
				</div>
				<div class="category-excerpt">
					<a href="<?php 
        the_permalink();
        ?>
"><h1 class="entry-title"><?php 
        the_title();
        ?>
</h1></a>
					<span>By 
						<?php 
        if (get_the_author_posts() == 1) {
            the_author();
            ?>
. <?php 
            the_tags();
            ?>
</span>
							<?php 
        } else {
            the_author_posts_link();
            ?>
. <?php 
            the_tags();
            ?>
</span>
						<?php 
コード例 #22
0
ファイル: widgets.php プロジェクト: Creativebq/wp-istalker
function wpi_widget_author_summary()
{
    global $authordata;
    if (!is_object($authordata)) {
        return;
    }
    $name = 'author-data';
    $title = 'Author details';
    wpi_widget_start($title, $name);
    $name = convert_chars($authordata->display_name);
    $url = $authordata->user_url != 'http://' ? $authordata->user_url : BLOGURL;
    $im = array();
    if (isset($authordata->aim) && !empty($authordata->aim)) {
        $attribs = array('title' => __('AOL Instant Messenger'), 'href' => 'aim:goim?screenname=' . $authordata->aim);
        $im['AIM'] = _t('a', $authordata->aim, $attribs) . ' ' . _t('a', 'profile', array('href' => 'http://profiles.aim.com/' . $authordata->aim));
    }
    if (isset($authordata->jabber) && !empty($authordata->jabber)) {
        $im['jabber'] = _t('a', $authordata->jabber, array('title' => __('eXtensible Messaging Jabber Client'), 'href' => 'xmpp:' . antispambot($authordata->jabber)));
    }
    if (isset($authordata->yim) && !empty($authordata->yim)) {
        $im['Yim'] = _t('a', $authordata->yim, array('title' => __('Yahoo Instant Messenger'), 'href' => 'ymsgr:sendIM?' . $authordata->yim));
    }
    ?>
	<div class="author-content">
		<ul class="xoxo r cf">
			<li><span>Name: </span> <?php 
    t('strong', $name);
    ?>
</li>
			<li><span>Website: </span> <?php 
    t('a', $url, array('href' => $url, 'rel' => 'me'));
    ?>
</li>
			<li><span>Articles: </span> <?php 
    echo get_the_author_posts();
    ?>
</li>
		<?php 
    if (has_count($im)) {
        foreach ($im as $k => $v) {
            t('li', $k . ': ' . $v);
        }
    }
    ?>
		</ul>
	</div>
<?php 
    wpi_widget_end();
}
コード例 #23
0
/**
 * Shortcode function for displaying the current post author posts number
 * Uses the get_the_author_posts() function
 * @link http://codex.wordpress.org/Template_Tags/the_author_posts
 *
 * @since 0.1
 */
function shortcode_the_author_posts()
{
    return get_the_author_posts();
}
コード例 #24
0
ファイル: content.php プロジェクト: anefzaoui/www-moztn
    ?>
</a>
        </time>
      </p>
    <?php 
}
?>

    <?php 
if (get_option('onemozilla_hide_authors') != 1) {
    ?>
      <address class="vcard"><cite class="author fn"><a class="url" href="<?php 
    echo esc_url(get_author_posts_url(get_the_author_meta('ID')));
    ?>
" title="<?php 
    printf(esc_attr__('See all %1$s posts by %2$s', 'onemozilla'), get_the_author_posts(), get_the_author());
    ?>
"><?php 
    esc_html(the_author());
    ?>
 <?php 
    echo get_avatar(get_the_author_meta('user_email'), 24);
    ?>
</a></cite></address>
    <?php 
}
?>

    <?php 
$comment_count = get_comments_number($post->ID);
if (comments_open() || pings_open() || $comment_count > 0) {
コード例 #25
0
/**
 * Display the number of posts by the author of the current post.
 *
 * @link http://codex.wordpress.org/Template_Tags/the_author_posts
 * @since 0.71
 * @uses get_the_author_posts() Echoes returned value from function.
 */
function the_author_posts()
{
    echo get_the_author_posts();
}
コード例 #26
0
    public static function filterContent($content = '')
    {
        if (is_single()) {
            $bab_showauttxt = get_option('bab_showauttxt');
            $bab_auttxt1 = get_option('bab_auttxt1');
            $bab_auttxt2 = get_option('bab_auttxt2');
            $bab_showautbio = get_option('bab_showautbio');
            $bab_showautintro = get_option('bab_showautintro');
            $bab_showautgra = get_option('bab_showautgra');
            $author = array();
            $author['name'] = get_the_author();
            $author['twitter'] = get_the_author_meta('twitter');
            $author['facebook'] = get_the_author_meta('facebook');
            $author['gplus'] = get_the_author_meta('gplus');
            $author['posts'] = (int) get_the_author_posts();
            ob_start();
            ?>
			<div id="better-author-bio-div">
				<div class="better-author-bio-div-info">
				        <?php 
            if ($bab_showautgra == 'y') {
                ?>
					<?php 
                echo get_avatar(get_the_author_meta('email'), '60');
                ?>
					<?php 
            }
            ?>
					<h4><?php 
            printf(esc_attr__('%s %s'), $bab_showautintro, get_the_author());
            ?>
</h4>
					
					<?php 
            if ($bab_showauttxt == 'y') {
                ?>
					<p class="better-author-bio-div-text"><?php 
                echo esc_attr(sprintf(_n('%s %s %d %s', '%s %s %d %s', $author['posts'], $bab_auttxt1, $bab_auttxt2, 'better-author-bio-div'), get_the_author_meta('first_name') . ' ' . get_the_author_meta('last_name'), $bab_auttxt1, $author['posts'], $bab_auttxt2));
                ?>
.</p>
					<?php 
            } else {
                echo "<br />";
            }
            ?>
					<?php 
            if ($bab_showautbio == 'y') {
                ?>
					<p class="better-author-bio-div-meta"><?php 
                echo get_the_author_meta('description');
                ?>
</p>
					<?php 
            } else {
                echo "<br />";
            }
            ?>
					<ul>
						<li class="first"><a href="<?php 
            echo get_author_posts_url(get_the_author_meta('ID'));
            ?>
">
									<?php 
            printf(__('View all posts by %s <span class="meta-nav">&rarr;</span>'), get_the_author());
            ?>
								</a></li>
						<li><a href="<?php 
            echo get_the_author_meta('url');
            ?>
" title="<?php 
            echo esc_attr(sprintf(__('Read %s&#8217;s blog', 'better-author-bio-div'), $author['name']));
            ?>
"><?php 
            echo __("Blog");
            ?>
</a></li>
						<?php 
            if (!empty($author['twitter'])) {
                ?>
						<li><a href="<?php 
                echo $author['twitter'];
                ?>
" title="<?php 
                echo esc_attr(sprintf(__('Follow %s on Twitter', 'better-author-bio-div'), $author['name']));
                ?>
" rel="external">Twitter</a></li>
						<?php 
            }
            ?>
						<?php 
            if (!empty($author['facebook'])) {
                ?>
						<li><a href="<?php 
                echo $author['facebook'];
                ?>
" title="<?php 
                echo esc_attr(sprintf(__('Be %s&#8217;s friend on Facebook', 'better-author-bio-div'), $author['name']));
                ?>
" rel="external">Facebook</a></li><?php 
            }
            ?>
                        <?php 
            if (!empty($author['gplus'])) {
                ?>
<li><a href="<?php 
                echo $author['gplus'];
                ?>
" rel="me" title="<?php 
                echo esc_attr(sprintf(__('Add %s in your circle', 'better-author-bio-div'), $author['name']));
                ?>
" rel="external">Google+</a></li>
						<?php 
            }
            ?>
                        <?php 
            if (!empty($author['lknin'])) {
                ?>
<li><a href="<?php 
                echo $author['lnkin'];
                ?>
"  title="<?php 
                echo esc_attr(sprintf(__('Connect with %s', 'better-author-bio-div'), $author['name']));
                ?>
" rel="external">LinkedIn</a></li>
						<?php 
            }
            ?>
					</ul>
				</div>
			</div>
			<?php 
            $bab_loc = get_option('bab_loc');
            $contend = $content;
            if ($bab_loc == 'bottom') {
                $content = $content . ob_get_clean();
            }
            if ($bab_loc == 'top') {
                $content = ob_get_clean() . $content;
            }
        }
        return $content;
    }