function widget($args, $instance) { global $post; extract($args); // only useful on post pages if (!is_single() || !largo_post_in_series()) { return; } $title = apply_filters('widget_title', empty($instance['title']) ? __('Related Series', 'largo') : $instance['title'], $instance, $this->id_base); echo $before_widget; /* Display the widget title if one was input */ if ($title) { echo $before_title . $title . $after_title; } global $post; $post_terms = largo_custom_taxonomy_terms($post->ID); //this is the only invocation of this function anywhere in Largo foreach ($post_terms as $term) { if (strtolower($term->name) == 'series') { continue; } echo largo_term_to_label($term); //this is the only invocation of this function anywhere in Largo } echo $after_widget; }
function test_largo_post_in_series() { // If series are disabled: of_set_option('series_enabled', false); $result = largo_post_in_series(); $this->assertFalse($result); // If series are enabled: of_set_option('series_enabled', 1); $this->markTestIncomplete('This test has not been implemented yet.'); }
<h2><a href="<?php the_permalink(); ?> "><?php the_title(); ?> </a></h2> <h5 class="byline"><?php largo_byline(); ?> </h5> <?php largo_excerpt($post, 4, false); ?> <?php if (largo_post_in_series()) { $feature = largo_get_the_main_feature(); $feature_posts = largo_get_recent_posts_for_term($feature, 1, 1); if ($feature_posts) { foreach ($feature_posts as $feature_post) { ?> <h4 class="related-story"> <?php _e('RELATED:', 'largo'); ?> <a href="<?php echo esc_url(get_permalink($feature_post->ID)); ?> "><?php echo get_the_title($feature_post->ID); ?>