with called .wvr-show-posts. (You
provide a CSS rule in the
Section of Advanced Options called .wvr-show-posts.) You can
add a class to that by providing a 'class=classname' option, where you use the name with a
period in the CSS in the Section, but just the classname for the [weaver-show-posts] option.
You can also provide inline styling by providing a 'style=value' option where value is whatever styling
you need, each terminated with a semi-colon (;).
The optional header is in a called .wvr_show_posts_header. You can add an additional class
name with 'header_class=classname'. You can provide inline styling with 'header_style=value'.
.wvr-show-posts .hentry {margin-top: 0px; margin-right: 0px; margin-bottom: 40px; margin-left: 0px;}
.widget-area .wvr-show-posts .hentry {margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;}
*/
global $id, $post, $wp_query, $more;
global $ttw_cur_post_id;
extract(shortcode_atts(array(
/* query_posts options */
'cats' => '', /* by slug, use - to exclude (cat, but convert slug to id) */
'tags' => '', /* by slug (tag) */
'author' => '', /* author - use nickname (auhor_name)*/
'single_post' => '', /* by slug - only one article (name) */
'orderby' => 'date', /* author | date | title | rand | modified | parent {date} (orderby) */
'sort' => 'DESC', /* ASC | DESC {DESC} (order)*/
'number' => '5', /* number of posts to show {5} (posts_per_page)*/
/* formatting options */
'show' => 'full', /* show: title | excerpt | full */
'hide_title' => '', /* hide the title? */
'hide_top_info' => '', /* hide the top info line */
'hide_bottom_info' => '', /* hide bottom info line */
'show_featured_image' => '', /* force showing featured image */
'show_avatar' => '', /* show the author avatar */
'show_bio' => '', /* show the bio below */
'excerpt_length' => '', /* override excerpt length */
'style' => '', /* inline CSS style for wvr-show-posts */
'class' => '', /* optional class to allow outside styling */
'header' => '', /* optional header for post */
'header_style' => '', /* styling for the header */
'header_class' => '', /* class for header */
'more_msg' => '' /* replacement for Continue Reading */
), $args));
$save_cur_post = $ttw_cur_post_id;
$save_post = $post; /* save state */
$save_q = $wp_query; // assign original query to temp variable for later use
$save_excerpt_length = ttw_getopt('ttw_excerpt_length');
if (!empty($excerpt_length)) ttw_setopt('ttw_excerpt_length',$excerpt_length);
$save_more_msg = ttw_getopt('ttw_excerpt_more_msg');
if (!empty($more_msg)) ttw_setopt('ttw_excerpt_more_msg', $more_msg);
/* Setup query arguments using the supplied args */
$qargs = array(
'ignore_sticky_posts' => 1
);
$qargs['orderby'] = $orderby; /* enter opts that have defaults first */
$qargs['order'] = $sort;
$qargs['posts_per_page'] = $number;
if (!empty($cats)) $qargs['cat'] = ttw_cat_slugs_to_ids($cats);
if (!empty($tags)) $qargs['tag'] = $tags;
if (!empty($single_post)) $qargs['name'] = $single_post;
if (!empty($author)) $qargs['author_name'] = $author;
$wp_query = new WP_Query($qargs);
// now modify the query using custom fields for this page
/* now start the content */
$div_add = '';
if (!empty($style)) $div_add = ' style="' . $style . '"';
$content = '
';
$h_add = '';
if (!empty($header_style)) $h_add = ' style="' . $header_style . '"';
if (!empty($header)) {
$content .= '';
}
ob_start(); // use built-in weaver code to generate a weaver standard post
while ( have_posts() ) {
the_post();
$ttw_cur_post_id = get_the_ID();
if (!is_sticky()) {
?>
>
work, still use single
ttw_the_content_featured_single(!empty($show_featured_image) ); ?>
');
?>
';
$ttw_cur_post_id = $save_cur_post;
$post = $save_post; //restore current page/post settings
unset($wp_query); // be nice, clean up
$wp_query = $save_q; // restore query
ttw_setopt('ttw_excerpt_length',$save_excerpt_length);
ttw_setopt('ttw_excerpt_more_msg',$save_more_msg);
return $content;
}
add_shortcode('weaver_show_posts', 'wvr_show_posts_sc');
?>