• I need a press release section in my WordPress based company website.

    I’ve tried adding a loop for posts from one category, “press releases”, to the news.php custom page template, but it only shows the content for the custom page.

    Is it possible to get posts from one category on a page? What code should I use for the loop?

    And then I’d also have to exclude the press releases category from the regular blog… How would I do that?

    Or is my approach all wrong? Isn’t there a plugin somewhere to create a slick press release section?

    Has anyone done something like this?

    EDIT:

    This adds one category to a page:

    <?php query_posts('cat=20');
    if (have_posts()) : while (have_posts()) : the_post(); ?>
    			<div <?php post_class() ?> id="post-<?php the_ID(); ?>">
    				<h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
    				<small><?php the_time('F jS, Y') ?> <!-- by <?php the_author() ?> --></small>
    
    				<div class="entry">
    					<?php	the_content('Read the rest of this entry ?'); ?>
    				</div>
    			</div>
    
    		<?php endwhile; ?>

    Excluding the category from the regular blog loop:

    <?php query_posts("cat=-20");
    if (have_posts()) : while (have_posts()) : the_post(); ?>

    Is this the best way to do it? In wp-admin and elsewhere the press releases get mixed up with regular blog posts. A plugin that streamlines this would be nice…

Viewing 1 replies (of 1 total)
  • Is this the best way to do it?

    Yes

    In wp-admin and elsewhere the press releases get mixed up with regular blog posts

    Try filtering the list by category.

Viewing 1 replies (of 1 total)
  • The topic ‘Create a press releases section’ is closed to new replies.