Пример #1
0
/**
 * Outputs, with formatting, when the 'episode' was posted and how long ago if applicable.
 * @return string
 */
function convergence_posted()
{
    $posted = "";
    $type = get_post_type();
    if (in_array($type, array('episode'))) {
        $ago = human_time_difference(get_the_date('U'), current_time('timestamp')) . ' ago';
        if (is_front_page()) {
            $ago = '';
        }
        $modified_date = get_the_modified_date("F jS Y");
        $modified_ago = human_time_difference(get_the_modified_date('U'), current_time('timestamp'));
        $posted = '<h4 class="show-date" title="Modified ' . $modified_date . ' (' . $modified_ago . ' ago)">' . get_the_date("F jS Y") . ': ' . $ago . '</h4>';
    }
    echo apply_atomic_shortcode('posted', $posted);
}
    echo convergence_episode_title((object) $post);
    ?>
</a></h4>
			<div><p><?php 
    echo $post['post_excerpt'];
    ?>
</p></div>
			<div class="meta">
				
				<div class="edit">
					<a href="<?php 
    echo get_edit_post_link($post['ID']);
    ?>
">Edit</a>
				</div>
				<div class="datetime">
					<?php 
    echo human_time_difference(strtotime($post['post_date']), current_time('timestamp')) . ' ago';
    ?>
				</div>

			</div>
		</div>
	<?php 
}
?>

	<br class="clear" />

	</div>
</div>