cookiescookies
Member
Posted 3 years ago #
i'm currently using a plugin to only show posts from one category on my main page. works great.
now i'm wondering how i can make the newest post of said category show the whole post, which it is now. but i want all the older posts that are showing up on the main page to only show the title, how do i go about this?
but i only want this to happen for this one category. when you navigate to the other posts, say monthly archives i want it to show the whole posts or excerpts, not just the title.
any ideas?
first, make a template page for the unique template http://codex.wordpress.org/Category_Templates#What_Template_File_is_Used.3F then in that template set a counter so that the loop only displays the full loop for the first post, then use the $post object http://wordpress.org/support/topic/168285?replies=2 to list only the titles of subsequent posts.
cookiescookies
Member
Posted 3 years ago #
thanks
that solves half of my problem.
my main page isn't pointing at the category in question. it is using a plugin to only show the category that i want. your fix seems to fix the problem when i go to the actual category page. not the main page
cookiescookies
Member
Posted 3 years ago #
so i did this so now it only shows the titles of the posts i want.
then what do so that the newest post in this category is at the top and is the full post? i'm having trouble limiting it to 1 post..
<?php get_header(); ?>
<div id="container">
<?php if(have_posts()) : ?><?php while(have_posts()) : the_post(); ?>
<div class="post" id="post-<?php the_ID(); ?>">
<h2><a href="<?php the_permalink(); ?>" title="<?php the_title() ?>"><?php the_title(); ?></a></h2>
</div>
<?php endwhile; ?>
<div class="navigation">
<?php posts_nav_link(); ?>
</div>
<?php else : ?>
<div class="post">
<h2><?php_e('Not Found') ?></h2>
</div>
<?php endif; ?>
</div>
<?php get_sidebar(); ?>
<?php get_footer(); ?>