• Hi ,

    My website is qbscapital.com and as you will see I want to have an events page where I want to show upcoming industry events.

    I enter the events as posts and I assign them to the “Events” category.

    How can I get it so that only posts that are assigned to the events category show up on my Events page?

    Any Help will be greatly appreciated.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Try the “associated posts” plugin.

    I used this when I created cigarsuckers.com
    Check it out and see if it is what you are looking for.
    If so, here is the link to the plugin…
    http://wpplugins.com/plugin/247/associated-posts-pro/

    Good luck!

    First Idea: copy all code from archive.php file and paste in new file “category-events.php

    OR

    2nd Idea.copy all code from page.php file and paste in new file “page-events.php

    Now add the following code before the “if” condition.

    <?php
     query_posts('category_name=events&posts_per_page=-1');
    ?>

    Best of Luck

    follow @mas instructions.

    Thread Starter qbscapital

    (@qbscapital)

    I guys. Thanks for the help.

    I am html illiterate so the solution from @mas sounds good except I donnt know what he means by

    “Now add the following code before the “if” condition.
    <?php
    query_posts(‘category_name=events&posts_per_page=-1’);
    ?>”

    What if statement in which file? do i do this in the page-events.php or in category-events.php

    you will put the code in page-events.php file

    Thread Starter qbscapital

    (@qbscapital)

    Thanks wprock and MAS.

    I tried those two things and it is still not working

    here is the code below for my page-events.php file. Where exactly should I put this line of code?

    <?php get_header(); ?>

    <div id=”columns”>
    <div id=”centercol”>
    <div class=”box”>
    <div class=”top”></div>
    <div class=”spacer”>

    <?php if(have_posts()) : ?><?php while(have_posts()) : the_post() ?>

    <div id=”post-<?php the_ID(); ?>” class=”post”>

    <h2>” rel=”bookmark” title=”<?php _e(‘Permanent Link to’,woothemes); ?> <?php the_title_attribute(); ?>”><?php the_title(); ?></h2>

    <div class=”entry”>
    <?php the_content(); ?>
    </div>

    </div>
    <!–/post–>

    <?php $comm = get_option(‘woo_comments’); if ( ($comm == “page” || $comm == “both”) ) : ?>
    <div id=”comments”><?php comments_template(”, true); ?></div>
    <?php endif; ?>

    <?php endwhile; else : ?>

    <div class=”post box”>
    <div class=”entry-head”><h2><?php _e(‘404 – Not Found’,woothemes); ?></h2></div>
    <div class=”entry-content”><p><?php _e(‘The page you are looking for is not here.’,woothemes); ?></p></div>
    </div>

    <?php endif; ?>
    <div class=”fix”></div>
    </div>
    <!–/spacer –>
    <div class=”bot”></div>
    </div>
    <!–/box –>
    </div>
    <!–/centercol –>

    <?php get_sidebar(); ?>

    <br class=”fix” />
    </div>
    <!–/columns –>

    <?php get_footer(); ?>

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Showing posts on Pages based on Categories’ is closed to new replies.