Example #1
0
/**
 * Called to display post heading for news in single posts
 * @since 1.2.2
 */
function arras_postheader()
{
    global $post, $id;
    $postheader = '';
    if (is_single() || is_page()) {
        if (is_attachment()) {
            $postheader .= '<h1 class="entry-title">' . get_the_title() . ' [<a href="' . get_permalink($post->post_parent) . '" rev="attachment">' . get_the_title($post->post_parent) . '</a>]</h1>';
        } else {
            $postheader .= '<h1 class="entry-title"><a href="' . get_permalink() . '" rel="bookmark">' . get_the_title() . '</a></h1>';
        }
    } else {
        if (is_attachment()) {
            $postheader .= '<h2 class="entry-title">' . get_the_title() . ' [<a href="' . get_permalink($post->post_parent) . '" rev="attachment">' . get_the_title($post->post_parent) . '</a>]</h2>';
        } else {
            if (!is_page()) {
                $postheader .= '<a class="entry-comments" href="' . get_comments_link() . '">' . get_comments_number() . '</a>';
            }
            $postheader .= '<h2 class="entry-title"><a href="' . get_permalink() . '" rel="bookmark">' . get_the_title() . '</a></h2>';
        }
    }
    if (!is_page()) {
        $postheader .= '<div class="entry-info">';
        if (arras_get_option('post_author')) {
            $postheader .= sprintf(__('<div class="entry-author">By %s</div>', 'arras'), '<address class="author vcard"><a class="url fn n" href="' . get_author_posts_url(get_the_author_meta('ID')) . '" rel="author" title="' . esc_attr(get_the_author()) . '">' . get_the_author() . '</a></address>');
        }
        if (arras_get_option('post_date')) {
            $postheader .= ' &ndash; <abbr class="published" title="' . get_the_time('c') . '">' . sprintf(__('Posted %s', 'arras'), arras_posted_on(false)) . '</abbr>';
        }
        if (current_user_can('edit_post')) {
            $postheader .= '<a class="post-edit-link" href="' . get_edit_post_link($id) . '" title="' . __('Edit Post', 'arras') . '">' . __('(Edit Post)', 'arras') . '</a>';
        }
        if (!is_attachment() && arras_get_option('post_cats')) {
            $post_cats = array();
            $cats = get_the_category();
            foreach ($cats as $c) {
                $post_cats[] = '<a href="' . get_category_link($c->cat_ID) . '">' . $c->cat_name . '</a>';
            }
            $postheader .= sprintf(__('<span class="entry-cat"><strong>Posted in: </strong>%s</span>', 'arras'), implode(', ', $post_cats));
        }
        $postheader .= '</div>';
    }
    if (arras_get_option('single_thumbs') && has_post_thumbnail($post->ID)) {
        $postheader .= '<div class="entry-photo">' . arras_get_thumbnail('single-thumb') . '</div>';
    }
    echo apply_filters('arras_postheader', $postheader);
}
Example #2
0
function arras_widgets_post_loop($id, $args = array())
{
    global $wp_query, $post;
    $_defaults = array('taxonomy' => 'category', 'show_thumbs' => true, 'show_excerpt' => true, 'query' => array('post_type' => 'post', 'posts_per_page' => 5, 'orderby' => 'date', 'order' => 'DESC'));
    $args['query'] = wp_parse_args($args['query'], $_defaults['query']);
    $args = wp_parse_args($args, $_defaults);
    $q = new WP_Query(arras_prep_query($args));
    if ($q->have_posts()) {
        echo '<ul class="' . $id . '">';
        while ($q->have_posts()) {
            $q->the_post();
            // hack for plugin authors who love to use $post = $wp_query->post
            $wp_query->post = $q->post;
            setup_postdata($post);
            ?>
 <li class="clearfix"> <?php 
            if ($args['show_thumbs']) {
                echo '<a rel="bookmark" href="' . get_permalink() . '" class="thumb">' . arras_get_thumbnail('sidebar-thumb', get_the_ID()) . '</a>';
            }
            ?>
			<a href="<?php 
            the_permalink();
            ?>
"><?php 
            the_title();
            ?>
</a><br />
			<span class="sub"><?php 
            printf(__('Posted %s', 'arras'), arras_posted_on(false));
            ?>
 | 
			<a href="<?php 
            comments_link();
            ?>
"><?php 
            comments_number(__('No Comments', 'arras'), __('1 Comment', 'arras'), __('% Comments', 'arras'));
            ?>
</a>
			</span>
			
			<?php 
            if ($args['show_excerpt']) {
                ?>
			<p class="excerpt">
			<?php 
                echo get_the_excerpt();
                ?>
			</p>
			<a class="sidebar-read-more" href="<?php 
                the_permalink();
                ?>
"><?php 
                _e('Read More', 'arras');
                ?>
</a>
			<?php 
            }
            ?>
			
			</li>
			<?php 
        }
        echo '</ul>';
    } else {
        echo '<span class="textCenter sub">' . __('No posts at the moment. Check back again later!', 'arras') . '</span>';
    }
    wp_reset_query();
}
Example #3
0
    function arras_tapestry_quick($dep = '', $taxonomy)
    {
        ?>
		<li <?php 
        arras_post_class();
        ?>
>
			<?php 
        echo apply_filters('arras_tapestry_quick_postheader', arras_generic_postheader('quick-preview'));
        ?>
			<div class="entry-summary">
				<div class="entry-info">
					<abbr class="published" title="<?php 
        the_time('c');
        ?>
"><?php 
        printf(__('Posted %s', 'arras'), arras_posted_on(false));
        ?>
</abbr> | <a href="<?php 
        comments_link();
        ?>
"><?php 
        comments_number();
        ?>
</a>
				</div>
				<?php 
        echo get_the_excerpt();
        ?>
				<p class="quick-read-more"><a href="<?php 
        the_permalink();
        ?>
" title="<?php 
        printf(__('Permalink to %s', 'arras'), get_the_title());
        ?>
">
				<?php 
        _e('Continue Reading...', 'arras');
        ?>
				</a></p>
			</div>	
		</li>
		<?php 
    }