• Hi, do somebody know any plugin, who can write titles of posts from only one category. There are normaly scripts which shows every titles and their content from all categories. I want only the titles.

Viewing 5 replies - 1 through 5 (of 5 total)
  • https://www.ads-software.com/support/topic/247551?replies=7

    <!-- here -->
    <?php $posts=query_posts($query_string . '&posts_per_page=10'); ?>
     <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
           <?php if ( in_category('wordpress') ) { ?>
    <h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
          <?php }; ?>
          <?php endwhile; ?>
    <?php endif; ?>
    <!-- here -->

    try something based on that. no need for a plugin

    Thread Starter m.mujgos

    (@mmujgos)

    it doesn′t show anything… and i have changed category right, any idea ? ??

    actually it does work, I’ve tested. can you post the code of your loop?

    Don’t forget to change ‘wordpress’ to your own category.

    What should I add to the code to bring out the title + the excerpt?

    Cheers!

    albertpr9,

    possibly this(?):

    <!-- here -->
    <?php $posts=query_posts($query_string . '&posts_per_page=10'); ?>
     <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
           <?php if ( in_category('wordpress') ) { ?>
    <h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
    <p><?php the_excerpt(); ?></p>
          <?php }; ?>
          <?php endwhile; ?>
    <?php endif; ?>
    <!-- here -->

    not sure about the wrapping ‘p’ tag, can’t remember off hand if it’s already in the excerpt or not.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Show titles from only one category’ is closed to new replies.