• Hi,

    I’m working hard on Station Free Theme for WordPress to setup our french music website. Well, here is the thing :
    – There’s a blog page called ‘news’ where all the articles are published.
    – But… I want to exclude few categories in this part (I test it with get_posts(‘cat=-xx’) but it doesn’t work : in some case, no articles are published ; or often, all articles are displayed) + (in .php, I try to make a conditional break with in_category() then ‘continue’ but it still doesn’t work)
    – those ‘excluded’ categories must be published on different sub-pages – as category lists (with just titles and a tiny excerpt), and I think it would be very hard to code, in a conditional way, because it’s static pages containing content edited from the back-end.
    If someone can help me to solve this issue (and give me some hints into the template’s files), it could be so wonderful.

Viewing 1 replies (of 1 total)
  • The way I would tackle this would be to use Custom Post Types. You’ll need to install a plug-in to create and manage them (I use Custom Content Type Manager).

    You then use a custom Query and loop to target these post types without having to use categories (which has the added bonus of freeing categories up for other uses).

    For example, my site also has news items and I use this code in place of the normal loop:

    <?php $newslist = new WP_Query(); ?>
    <?php $args = array( 'post_type' => 'news', 'post_status' => 'publish', 'cat' => '-5' ); ?>
    <?php $newslist->query($args); ?>
    <?php while($newslist->have_posts()) : $newslist->the_post(); ?>

    Hope that helps

    Peter

    PS: 'cat' => '-5' is used to exclude news posts with a category id of 5 (which on that particular site is called “Archive”) – I use that to mark posts as being old and not to be included.

Viewing 1 replies (of 1 total)
  • The topic ‘How to manage Categories with STATION [FREE] ?’ is closed to new replies.