Forum Replies Created
- AuthorPosts
- April 29, 2014 at 2:42 am in reply to: Custom Page Template for Custom Content Type displaying weird results #2200pwcurtisParticipant
Quick update, I modified the loop in page-news.php to read:
<?php $args = array( ‘post_type’ => ‘news’); ?>
<?php $loop = new WP_Query( $args ); ?><?php while ( $loop->have_posts() ) : $loop->the_post(); ?>
<?php get_template_part( ‘content’, ‘page’ ); ?>
<?php endwhile; // end of the loop. ?>Removing this command solved the problem with comments showing up: <?php comments_template( ”, true ); ?>
Also, I realize I may need a content-news.php
(based on: <?php get_template_part( ‘content’, ‘page’ ); ?>)
I copied content.php from the theme folder, into the child theme folder and renamed it content-news.php. That did not solve the formatting issue either.At this point I am a bit stuck. I’m sure dev can offer a bit of help during business hours tomorrow. Thanks!
April 28, 2014 at 10:07 pm in reply to: Custom Page Template for Custom Content Type displaying weird results #2199pwcurtisParticipantWith additional testing, I have noticed that the news articles display correctly in this view (I am sharing tags and categories between “post”, and “news” content types, so this works) http://petersblog.us/tag/microsoft/
I think that rules out how my custom content type is setup. I am guessing it has to do with how my query is setup (I pulled this originally from wordpress codex):
<?php $args = array( ‘post_type’ => ‘news’, ‘posts_per_page’ => 10 ); ?>
<?php $loop = new WP_Query( $args ); ?><?php while ( $loop->have_posts() ) : $loop->the_post(); ?>
I tried removing the “‘posts_per_page’ => 10 ” statement. It had no effect on formatting. I don’t have more than 10 articles published yet either.
- AuthorPosts