• I am trying to post articles to certain categories ONLY, without them showing up on my Front Page too.

    I have tried various ways of working the static and post pages but to no avail.

    This is what I want:

    When people open into my front page, they will see news articles of current world events.
    BUT I also want to post information in a “philosophy” category without it showing up on the front page also. But the way things are, when I Add Post to a SPECIFIC category it will ALSO be displayed on front page.

    I am new. Also, I have limited knowledge in xhtml and code (but minimal experience a few years ago).

    My host company is blue host.

    my site is https://www.americanpendulum.com

    Please let me know. I have read and looked everywhere for this info but can’t find it.

    Thanks.
    Cokeefe

Viewing 2 replies - 1 through 2 (of 2 total)
  • There are two ways to go about this, you can exclude certain categories from your homepage, or you can include only certain categories. So if you have 8 categories and you only want 6 to show up on the homepage, best to exclude the other 2. If you only want 1 of the 8 listed on the homepage, better to just include that one.

    Either way, you will need to setup a custom Loop for your homepage.

    How you do this will really depend on your theme. It looks like you are using the default theme right now, which means it is loading the index.php template on your homepage, you don’t want to edit this file because you will need to use it deeper in the site on categories that will not be on the homepage.

    So you would want to create a home “Page”, and set that to your homepage. Then create a custom page template that loads just the categories you want.

    Here’s an example of a Loop that’d exlude a category. Fair warning, you’d have to get your hands pretty dirty to build this in the default theme.

    It sounds like you want a “magazine” style layout for your site with the categories broken up into different sections of the site. There are quite a few magazine style themes out there that make it easier to this, loading certain categories on the homepage, or blocks of the homepage. Magazeen is on free example, you could find many commercial themes like this as well.

    Try amending the index.php template in your theme from:

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

    to:

    <?php if (have_posts()) : ?>
    <?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
    $args= array(
    	'cat' => -10,
    	'paged' => $paged
    );
    query_posts($args);?>
    <?php while (have_posts()) : the_post(); ?>

    where 10 is the id of your Philosophy category.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Posting Articles to Categories only’ is closed to new replies.