Exemple #1
0
function arras_make_slide()
{
    global $post;
    $slide_data = ' data-title="' . get_the_title() . '" data-cycle-excerpt="' . get_the_excerpt() . '" data-cycle-link="' . get_the_permalink() . '"';
    $slide = '<a href="' . get_the_permalink() . '" ' . $slide_data . '>';
    // link tag with slide data
    $slide .= arras_get_thumbnail('wide-thumbnail');
    // image
    $slide .= '</a>';
    // close link tag
    return $slide;
}
Exemple #2
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')) . '" 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') . '">' . get_the_time(get_option('date_format')) . '</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);
}
Exemple #3
0
/**
 * Called to display post heading for news in index and archive pages
 * @since 1.2.2
 */
function arras_newsheader($page_type)
{
    global $post;
    $postheader = '<div class="entry-thumbnails">';
    $postheader .= '<a class="entry-thumbnails-link" href="' . wpmu_link() . '">';
    if ($thumbnail = arras_get_thumbnail($page_type . '-post-thumb')) {
        $postheader .= '<img src="' . $thumbnail . '" alt="' . get_the_title() . '" title="' . get_the_title() . '" />';
    } else {
        $postheader .= '<span style="display: none">' . get_the_title() . '</span>';
    }
    $postheader .= '</a>';
    if (arras_get_option($page_type . '_display_meta_inpic')) {
        $postheader .= '<span class="entry-meta"><a href="' . wpmu_link() . '"><span class="entry-comments">' . get_comments_number() . '</span></a>';
        $postheader .= '<abbr class="published" title="' . get_the_time('c') . '">' . get_the_time(get_option('date_format')) . '</abbr></span>';
    }
    $postheader .= '</div>';
    $postheader .= '<h3 class="entry-title"><a href="' . wpmu_link() . '" rel="bookmark">' . get_the_title() . '</a></h3>';
    echo apply_filters('arras_newsheader', $postheader);
}
Exemple #4
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();
}
/**
 * Helper function to display headers for certain tapestries.
 * @since 1.4.3
 */
function arras_generic_postheader($tapestry, $show_meta = false)
{
    global $post;
    $postheader = '<div class="entry-thumbnails">';
    $postheader .= '<a class="entry-thumbnails-link" href="' . get_permalink() . '">';
    $postheader .= arras_get_thumbnail($tapestry . '-thumb');
    if ($show_meta) {
        $postheader .= '<span class="entry-meta"><span class="entry-comments">' . get_comments_number() . '</span>';
        $postheader .= '<abbr class="published" title="' . get_the_time('c') . '">' . get_the_time(get_option('date_format')) . '</abbr></span>';
    }
    $postheader .= '</a>';
    $postheader .= '</div>';
    $postheader .= '<h3 class="entry-title"><a href="' . get_permalink() . '" rel="bookmark">' . get_the_title() . '</a></h3>';
    return $postheader;
}
function arras_add_slideshow()
{
    global $post_blacklist, $paged;
    if (!is_home() || $paged) {
        return false;
    }
    $slideshow_cat = arras_get_option('slideshow_cat');
    if (arras_get_option('enable_slideshow') == false) {
        return false;
    }
    $query = arras_prep_query(array('list' => $slideshow_cat, 'taxonomy' => arras_get_option('slideshow_tax'), 'query' => array('posts_per_page' => arras_get_option('slideshow_count'), 'exclude' => $post_blacklist, 'post_type' => arras_get_option('slideshow_posttype'), 'paged' => $paged)));
    $q = new WP_Query(apply_filters('arras_slideshow_query', $query));
    if ($q->have_posts()) {
        ?>
 
	<!-- Featured Slideshow -->
	<div class="featured clearfix">
		<?php 
        if ($q->post_count > 1) {
            ?>
		<div id="controls">
			<a href="" class="prev"><?php 
            _e('Prev', 'arras');
            ?>
</a>
			<a href="" class="next"><?php 
            _e('Next', 'arras');
            ?>
</a>
		</div>
		<?php 
        }
        ?>
		<div id="featured-slideshow">
			<?php 
        $count = 0;
        ?>
		
			<?php 
        while ($q->have_posts()) {
            $q->the_post();
            ?>
			<div class="featured-slideshow-inner" <?php 
            if ($count != 0) {
                echo 'style="display: none"';
            }
            ?>
>
				<a class="featured-article" href="<?php 
            the_permalink();
            ?>
" rel="bookmark">
				<?php 
            echo arras_get_thumbnail('featured-slideshow-thumb');
            ?>
				</a>
				<div class="featured-entry">
					<a class="entry-title" href="<?php 
            the_permalink();
            ?>
" rel="bookmark"><?php 
            the_title();
            ?>
</a>
					<div class="entry-summary"><?php 
            the_excerpt();
            ?>
</div>
					<div class="progress"></div>
				</div>
			</div>
			<?php 
            arras_blacklist_duplicates();
            // required for duplicate posts function to work.
            $count++;
        }
        ?>
		</div>
	</div>
	<?php 
    }
}
Exemple #7
0
if (have_posts()) {
    while (have_posts()) {
        the_post();
        ?>
	<?php 
        arras_above_post();
        ?>
	
	<div class="featured clearfix">
		<div id="featured-slideshow">
			<div>
				<a class="featured-article" href="<?php 
        echo wpmu_link();
        ?>
" rel="bookmark" style="background: url(<?php 
        echo arras_get_thumbnail('featured-slideshow-thumb');
        ?>
) no-repeat #1E1B1A;">
					<span class="featured-entry">
						<span class="entry-title"><?php 
        the_title();
        ?>
</span>
						<span class="progress"></span>
					</span>
				</a>
			</div>
		</div>
	</div>
	
	<div id="post-<?php 
/**
 * Called to display post heading for news in single posts
 * @since 1.2.2
 */
function arras_postheader()
{
    global $post, $id;
    if (is_single()) {
        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 {
            $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(__('<span class="entry-author">By %s</span>', 'arras'), '<address class="author vcard">' . get_the_author() . '</address>');
        }
        if (arras_get_option('post_date')) {
            $postheader .= sprintf(__('<strong>Published:</strong> %s', 'arras'), '<abbr class="published" title="' . get_the_time('c') . '">' . get_the_time(get_option('date_format')) . '</abbr>');
        }
        if (arras_get_option('post_cats')) {
            $post_cats = array();
            $cats = get_the_category();
            foreach ($cats as $c) {
                $post_cats[] = $c->cat_name;
            }
            $postheader .= sprintf(__('<span class="entry-cat"><strong>Posted in: </strong>%s</span>', 'arras'), implode(', ', $post_cats));
        }
        if (arras_get_option('post_tags') && !is_attachment()) {
            $postheader .= '<span class="tags"><strong>' . __('Tags:', 'arras') . '</strong>' . get_the_tag_list(' ', ', ', ' ') . '</span>';
        }
        $postheader .= '</div>';
    }
    $lead = get_post_meta($post->ID, ARRAS_POST_THUMBNAIL, true);
    if ($lead) {
        if (arras_get_option('layout') == '3c-r-fixed' || arras_get_option('layout') == '3c-fixed') {
            $w = ARRAS_3COL_FULL_WIDTH;
            $h = ARRAS_3COL_FULL_HEIGHT;
        } else {
            $w = ARRAS_2COL_FULL_WIDTH;
            $h = ARRAS_2COL_FULL_HEIGHT;
        }
        $postheader .= '<div class="entry-photo"><img src="' . arras_get_thumbnail($w, $h) . '" alt="' . get_the_title() . '" title="' . get_the_title() . '" /></div>';
    }
    if (arras_get_option('postbar_header') && is_single() && !is_attachment()) {
        $postheader .= arras_postbar();
    }
    echo apply_filters('arras_postheader', $postheader);
}
Exemple #9
0
            }
            ?>
>
    			<?php 
            $w = 630;
            $h = 250;
            if (arras_get_option('layout') == '3c-r-fixed' || arras_get_option('layout') == '3c-fixed') {
                $w = 480;
                $h = 225;
            }
            ?>
            	<a class="featured-article" href="<?php 
            the_permalink();
            ?>
" rel="bookmark" style="background: url(<?php 
            echo arras_get_thumbnail($w, $h);
            ?>
) no-repeat;">
                <span class="featured-entry">
                    <span class="entry-title"><?php 
            the_title();
            ?>
</span>
                    <span class="entry-summary"><?php 
            echo arras_strip_content(get_the_excerpt(), 20);
            ?>
</span>
					<span class="progress"></span>
                </span>
            	</a>
        	</div>
Exemple #10
0
    function widget($args, $instance)
    {
        global $wpdb;
        extract($args, EXTR_SKIP);
        if ($instance['no_display_in_home'] && is_home()) {
            return false;
        }
        $title = apply_filters('widget_title', $instance['title']);
        echo $before_widget;
        echo $before_title . $title . $after_title;
        $q = arras_parse_query($instance['featured_cat'], $instance['postcount']);
        $r = new WP_Query($q);
        if ($r->have_posts()) {
            echo '<ul class="featured-stories">';
            while ($r->have_posts()) {
                $r->the_post();
                ?>
		<li class="clearfix">
			<?php 
                if (isset($instance['show_thumbs'])) {
                    ?>
<div class="thumb"><?php 
                    echo arras_get_thumbnail('sidebar-thumb', get_the_ID());
                    ?>
</div><?php 
                }
                ?>
			<div class="featured-stories-summary">
			<a href="<?php 
                the_permalink();
                ?>
"><?php 
                the_title();
                ?>
</a><br />
			<span class="sub"><?php 
                the_time(__('d F Y g:i A', 'arras'));
                ?>
 | 
			<?php 
                comments_number(__('No Comments', 'arras'), __('1 Comment', 'arras'), __('% Comments', 'arras'));
                ?>
</span>
			
			<?php 
                if ($instance['show_excerpts']) {
                    ?>
			<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 
                }
                ?>
			</div>
		</li>
		<?php 
            }
            echo '</ul>';
        }
        echo $after_widget;
    }