コード例 #1
0
<?php

/**
 * Partial template displaying the author's activity summary in the banner.
 *
 * @package     Reach
 */
if (!reach_has_charitable()) {
    return;
}
$user = charitable_get_user(reach_get_current_author()->ID);
$campaigns = Charitable_Campaigns::query(array('author' => $user->ID));
?>
<div class="author-activity-summary">
	<span class="number"><?php 
echo $user->count_campaigns_supported();
?>
</span>&nbsp;<?php 
_e('Campaigns Backed', 'reach');
?>
&nbsp;<span class='separator'>/</span>&nbsp;<span class="number"><?php 
echo $campaigns->post_count;
?>
</span>&nbsp;<?php 
_e('Campaigns Created', 'reach');
?>
</div><!-- .author-activity-summary -->
コード例 #2
0
<?php

/**
 * Partial template displaying donations in the activity feed shown on user profiles.
 *
 * @package     Reach
 */
if (!reach_has_charitable()) {
    return;
}
$donation = charitable_get_donation(get_the_ID());
$campaign_id = current($donation->get_campaign_donations())->campaign_id;
?>
<li class="activity-type-donation cf">
	<p class="activity-summary">
		<?php 
printf(_x('%1$s backed %2$s', 'user backed campaign(s)', 'reach'), '<span class="display-name">' . reach_get_current_author()->display_name . '</span>', $donation->get_campaigns_donated_to(true));
?>
<br />
		<span class="time-ago"><?php 
printf(_x('%s ago', 'time ago', 'reach'), human_time_diff(get_the_time('U'), current_time('timestamp')));
?>
</span>
	</p>
	<?php 
if (has_post_thumbnail($campaign_id)) {
    echo get_the_post_thumbnail($campaign_id, 'thumbnail');
}
?>
</li><!-- .activity-type-donation -->
コード例 #3
0
ファイル: author-avatar.php プロジェクト: Charitable/Reach
<?php

/**
 * Partial template displaying the author's avatar.
 *
 * @package     Reach
 */
$size = 140;
if (reach_has_charitable()) {
    $avatar = reach_get_current_charitable_user()->get_avatar($size);
} else {
    $avatar = get_avatar(reach_get_current_author()->ID, $size);
}
?>
<div class="author-avatar">
	<?php 
echo $avatar;
?>
</div><!-- .author-avatar -->
コード例 #4
0
<?php

/**
 * Partial template displaying posts in the activity feed shown on user profiles.
 *
 * @package 	Reach
 */
?>
<li class="activity-type-post cf">
	<p class="activity-summary">
		<?php 
printf(_x('%1$s published %2$s', 'user published post', 'reach'), '<span class="display-name">' . reach_get_current_author()->display_name . '</span>', '<a href="' . get_permalink() . '" title="' . the_title_attribute(array('echo' => false)) . '">' . get_the_title() . '</a>');
?>
<br />
		<span class="time-ago"><?php 
printf(_x('%s ago', 'time ago', 'reach'), human_time_diff(get_the_time('U'), current_time('timestamp')));
?>
</span>
	</p>
	<?php 
if (has_post_thumbnail()) {
    the_post_thumbnail('thumbnail');
}
?>
</li><!-- .activity-type-post -->
コード例 #5
0
ファイル: author.php プロジェクト: Charitable/Reach
<?php

/**
 * The template for displaying public user profiles.
 *
 * Learn more: http://codex.wordpress.org/Template_Hierarchy
 *
 * @package     Reach
 */
$author = reach_get_current_author();
$first_name = strlen($author->first_name) ? $author->first_name : $author->display_name;
get_header();
?>
<main id="main" class="site-main site-content cf">  
	<div class="layout-wrapper">
		<div id="primary" class="content-area">
			<?php 
get_template_part('partials/banner', 'author');
?>
			<div class="entry-block block">
				<div class="entry cf">
					<div class="author-description">
						<?php 
get_template_part('partials/author', 'avatar');
?>
                        
						<div class="author-facts">
							<h2><?php 
printf(_x('About %s', 'about person', 'reach'), $first_name);
?>
</h2>
コード例 #6
0
ファイル: helper-functions.php プロジェクト: Charitable/Reach
/**
 * Return the banner title for the current page.
 *
 * @return  string
 * @since   1.0.0
 */
function reach_get_banner_title()
{
    $title = '';
    /* Homepage */
    if (is_home()) {
        if ('page' == get_option('show_on_front')) {
            $title = get_the_title(get_option('page_for_posts'));
        } else {
            $title = apply_filters('reach_banner_title_posts', '');
        }
    } elseif (is_404()) {
        $title = apply_filters('reach_banner_title_404', '404');
    } elseif (is_author()) {
        $author = reach_get_current_author();
        $title = apply_filters('reach_banner_title_author', $author->display_name, $author);
    } elseif (is_search()) {
        $title = apply_filters('reach_banner_title_search', sprintf(__('Search Results for: %s', 'reach'), get_search_query()));
    } elseif (is_post_type_archive()) {
        $title = apply_filters('reach_banner_title_post_type_archive', post_type_archive_title('', false));
    } elseif (is_year()) {
        $title = apply_filters('reach_banner_title_year_archive', sprintf(__('Year: %s', 'reach'), get_the_date(_x('Y', 'yearly archives date format', 'reach'))));
    } elseif (is_month()) {
        $title = apply_filters('reach_banner_title_month_archive', sprintf(__('Month: %s', 'reach'), get_the_date(_x('F Y', 'monthly archives date format', 'reach'))));
    } elseif (is_day()) {
        $title = apply_filters('reach_banner_title_day_archive', sprintf(__('Day: %s', 'reach'), get_the_date(_x('F j, Y', 'daily archives date format', 'reach'))));
    } elseif (is_archive()) {
        $title = apply_filters('reach_banner_title_archive', single_term_title('', false));
    } else {
        $title = apply_filters('reach_banner_title_page', get_the_title());
    }
    return apply_filters('reach_banner_title', $title);
}