function atw_posts_define_display() { // define display filter options ?> <h3><u>Define Post Display Filter Options</u></h3> <div class="filter-section"> <div class="filter-title">• Post Display <span class="filter-title-description">When displaying posts, use these display options. Don't apply to image sliders.</span></div> <div class="filter-opts"> <?php $has_templates = atw_posts_theme_has_templates(); if ($has_templates && atw_posts_is_generic() && atw_posts_getopt('use_native_theme_templates')) { ?> <span style="display:inline;padding-left:2.5em;text-indent:-1.7em;"></span> <em>Post Display Options not available when using your theme's content display as checked in the option above.</em><br /><br /> <?php } else { atw_posts_filter_checkbox('hide_title', 'Hide Post Title', ''); atw_posts_filter_checkbox('show_avatar', 'Show Author Avatar'); atw_posts_filter_checkbox('hide_top_info', 'Hide Top Post Meta Info (date, author)', ''); atw_posts_filter_checkbox('hide_bottom_info', 'Hide Bottom Post Meta Info (category, tag, comment link)'); atw_posts_filter_checkbox('hide_featured_image', 'Hide Featurd Image in post (default: show; or theme defaults)', ''); echo '<br />'; atw_posts_filter_textarea('more_msg', '"Continue Reading..." message for excerpts.'); $cur_show = atw_posts_get_filter_opt('show'); ?> <div style="padding:1em 0 .5em 4em;text-indent:-1.7em;">Display posts as: <select name="show"> <option value="" <?php selected($cur_show == ''); ?> ></option> <option value="full" <?php selected($cur_show == 'full'); ?> >Full post</option> <option value="excerpt" <?php selected($cur_show == 'excerpt'); ?> >Excerpt</option> <option value="title" <?php selected($cur_show == 'title'); ?> >Title + Top Meta Line</option> <option value="titlelist" <?php selected($cur_show == 'titlelist'); ?> >Title only as list</option> <option value="title_featured" <?php selected($cur_show == 'title_featured'); ?> >Title + Featured Image</option> </select> How to display posts - (Default: full post; Weaver theme settings) </div> <?php } // else not getting from gallery ?> </div> <div style="clear:both;"></div> <div class="filter-description"> <p> Use this section to define how each post is to be displayed - title, excerpted, etc. These options apply to how each post is displayed when using the plugin's built-in post layout, or when used with native Weaver Xtreme or Weaver II layout. Use the Content Selection Filter to define which posts will be displayed. The Slider Image Show options can be used to define how images are used in a image only slide show. (Note: when using the Weaver Slider plugin to display an image slider, these Post Display options do not apply.) </p> </div> </div> <?php }
function atw_show_content($slider, $filter = '') { $cur_post_id = get_the_ID(); /* We have to do our own sticky processing because WP is_sticky() will not work because we are in our own WP_Query, * and will thus never be on the home page which is one of the tests in the core is_sticky() */ $sticky = is_sticky($cur_post_id); do_action('atw_show_sliders_post_pager', $slider); $saved_the_content_filter_key = atw_save_the_content_filters(); if (!atw_posts_getopt('ignore_aspen_weaver') && (atw_posts_is_wvrx() || atw_posts_is_aspen() || atw_posts_is_wii()) || atw_posts_getopt('use_native_theme_templates') && atw_posts_theme_has_templates()) { if ($sticky) { echo '<div class="sticky">'; } if (atw_posts_is_wvrx()) { get_template_part('templates/content', get_post_format()); } else { if (function_exists('twentysixteen_setup')) { // custom support for twentysixteen get_template_part('template-parts/content', get_post_format()); } else { get_template_part('content', get_post_format()); } } if ($sticky) { echo '</div>'; } echo "<div style='clear:both;'></div>\n"; atw_restore_the_content_filters($saved_the_content_filter_key); return; } if (WEAVER_SHOWPOSTS_TEMPLATE) { $template = atw_posts_get_filter_opt('post_template', $filter); if ($template != '') { atw_posts_do_template($slider, $template); atw_restore_the_content_filters($saved_the_content_filter_key); return; } } $add_class = 'atw-post'; if ($sticky) { $add_class .= ' sticky'; } ?> <article id="post-<?php the_ID(); ?> " <?php post_class($add_class); ?> > <header class="atw-entry-header"> <?php if (!atw_trans_get('hide_title')) { // ========== TITLE ?> <hgroup class="atw-entry-hdr"><h2 class="atw-entry-title"> <a href="<?php the_permalink(); ?> " title="<?php printf(esc_attr(__('Permalink to %s', 'show-posts')), the_title_attribute('echo=0')); ?> " rel="bookmark"><?php the_title(); ?> </a> </h2></hgroup> <?php } if (!atw_trans_get('hide_top_info')) { // ============ TOP META ?> <div class="atw-entry-meta"> <div class="atw-entry-meta-icons"> <?php printf(__('<span class="entry-date"><a href="%1$s" title="%2$s" rel="bookmark"><time datetime="%3$s" pubdate>%4$s</time></a></span> <span class="by-author"><span class="author vcard"><a class="url fn n" href="%5$s" title="%6$s" rel="author">%7$s</a></span></span>', 'show-posts'), esc_url(get_permalink()), esc_attr(get_the_time()), esc_attr(get_the_date('c')), esc_html(get_the_date()), esc_url(get_author_posts_url(get_the_author_meta('ID'))), sprintf(esc_attr(__('View all posts by %s', 'show-posts')), get_the_author()), esc_html(get_the_author())); if (atw_trans_get('show_avatar') != '' && atw_trans_get('show_avatar') != 'no') { echo ' ' . get_avatar(get_the_author_meta('user_email'), 22, null, 'avatar'); } ?> </div><!-- .atw-entry-meta-icons --> </div><!-- .atw-entry-meta --> <?php } ?> </header><!-- .atw-entry-header --> <?php if (atw_trans_get('show') == 'title') { echo '</article><!-- #post-' . get_the_ID() . '-->'; atw_restore_the_content_filters($saved_the_content_filter_key); return; } if (atw_trans_get('show') == 'title_featured') { if (get_post_thumbnail_id()) { $image = wp_get_attachment_image_src(get_post_thumbnail_id(), 'thumbnail'); // (url, width, height) $href = $image[0]; ?> <p class='atw-featured-image'><a href="<?php echo $href; ?> "><?php esc_url(the_post_thumbnail('thumbnail')); ?> </a></p> <?php } echo '</article><!-- #post-' . get_the_ID() . '-->'; atw_restore_the_content_filters($saved_the_content_filter_key); return; } if (atw_trans_get('show') == 'excerpt') { // =================== EXCERPT ?> <div class="atw-entry-summary atw-cf"> <?php atw_show_post_content($slider); ?> </div><!-- .atw-entry-summary --> <?php } else { // ================== FULL CONTENT ?> <div class="atw-entry-content atw-cf"> <?php atw_show_post_content($slider); ?> </div><!-- .atw-entry-content --> <?php } if (!atw_trans_get('hide_bottom_info')) { // ================= BOTTOM META ?> <footer class="atw-entry-utility"> <div class="atw-entry-meta-icons"> <?php $categories_list = get_the_category_list(__(', ', 'show-posts')); if ($categories_list) { ?> <span class="cat-links"> <?php echo $categories_list; ?> </span> <?php } // End if categories $tags_list = get_the_tag_list('', __(', ', 'show-posts')); if ($tags_list) { ?> <span class="tag-links"> <?php echo $tags_list; ?> </span> <?php } // End if $tags_list if (comments_open()) { ?> <span class="comments-link"> <?php comments_popup_link(__('Leave a reply', 'show-posts'), __('<b>1</b> Reply', 'show-posts'), __('<b>%</b> Replies', 'show-posts'), 'leave-reply'); ?> </span><div style="clear:both;"></div> <?php } // End if comments_open() ?> </div><!-- .entry-meta-icons --> </footer><!-- .atw-entry-utility --> <?php } edit_post_link(__('Edit', 'show-posts'), '<span class="atw-edit-link">', '</span>'); ?> </article><!-- #post-<?php the_ID(); ?> --> <?php atw_restore_the_content_filters($saved_the_content_filter_key); }