Closed jeremycherfas closed 6 years ago
Can you post your custom loop code? I can take a look. Or just show me the entire template. I suspect there's an issue with your loop placement.
Sure; and thanks for the prompt reply. It is a bit cargo-cult, but other than that works.
<?php
/**
* Template Name: OurDailyBread
* The template for displaying content in one categtory.
*
*/
get_header(); ?>
<div id="primary" class="content-area">
<main id="main" class="site-main" role="main">
<?php
$paged = (get_query_var( 'paged' )) ? get_query_var( 'paged' ) : 1;
$args = array(
'post_type' => 'post',
'post_status' => 'publish',
'cat' => '67',
'posts_per_page' => 5,
'paged' => $paged,
);
$arr_posts = new WP_Query( $args );
if ( $arr_posts->have_posts() ) :
while ( $arr_posts->have_posts() ) :
$arr_posts->the_post();
?>
<?php get_template_part( 'content', 'page' ); ?> // this is my standard page, which displays subtitle fine
<?php
endwhile;
endif;
?>
</main><!-- .site-main -->
</div><!-- .content-area -->
<?php get_sidebar(); ?>
<?php get_footer(); ?>
Thanks. I'll look today. Just waking up. 🙂
Sent from my iPhone
On Jul 27, 2018, at 00:05, jeremycherfas notifications@github.com wrote:
Sure; and thanks for the prompt reply. It is a bit cargo-cult, but other than that works.
<?php /**
- Template Name: OurDailyBread
- The template for displaying content in one categtory.
*/
get_header(); ?>
— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.'post', 'post_status' => 'publish', 'cat' => '67', 'posts_per_page' => 5, 'paged' => $paged, ); $arr_posts = new WP_Query( $args ); if ( $arr_posts->have_posts() ) : while ( $arr_posts->have_posts() ) : $arr_posts->the_post(); ?> // this is my standard page, which displays subtitle fine
@jeremycherfas I'm very sorry to have left you hanging on this. Did you end up ditching the plugin/theme conflict or do you still need help?
Well, I didn't ditch it, but I am not able to display subtitles either. And I seem to be able to live without ...
Thanks for the update. I will mark this closed but please see this.
In your case, the following code snippet would probably work:
if ( function_exists( 'the_subtitle' ) ) {
the_subtitle( '<p class="entry-subtitle">', '</p>' );
}
Issue Overview
Not seeing subtitles in a custom page template
That's it, really. I wanted to create a page that displays only a certain category, but not a category display page. I did that with some fairly simple selections and a new WP_Query. A loop then displays the selected posts.
I don't quite understand whether this is THE loop or another loop. If it is another loop, I don't understand how to ensure that subtitles will display by using https://github.com/wecobble/Subtitles#modifying-supported-subtitles-views
Thanks