Forum Replies Created

Viewing 7 replies - 1 through 7 (of 7 total)
  • Jeez,

    Doesn’t work for $query->is_page(‘x’) instead of $query->is_home. Can somebody PLEASE add the multiple page functionality or make a decent plugin based on Category Page which doesn’t require any external editing?

    Thanks,
    Brad

    Found an even more elegant solution to excluding items from the front page at https://blogmum.com/2009/04/how-to-exclude-categories-from-the-home-page-of-your-wordpress-blog/

    Firstly, you need to find the number of the category you want to exclude:

    * go into Posts > Categories
    * click on the relevent category name
    * the URL of the next page should end &cat_ID=xx, where xx is a number. Make a note of it.

    Next, go into Appearance > Editor, and open functions.php. Add the following function at the very end of the file just before ?>:

    function exclude_category($query) {
    if ( $query->is_home ) {
    $query->set('cat', '-xx');
    }
    return $query;
    }
    add_filter('pre_get_posts', 'exclude_category');

    where xx is the number of your category. Don’t forget the minus sign in front of it! Save it, and you’re done. You can exclude multiple categories with ‘-xx,-yy,-zz…’

    Cheers,
    Brad

    Actually, I cannot get the EXCLUDE statement to work:

    elseif(is_page('8')){query_posts("cat=-3");}

    I’ve had to use the plugin ‘Frontpage Exclude Categories’.

    Anyhow, all is good, just not perfect.

    Okay, it is very simple. Go to your /wp-content/themes/[theme] directory and copy page.php to page.php.old and then edit your page.php to look similar to the following:

    <?php get_header(); ?>
    <?php sy_pre_content(); ?>
    <div id="content">
    
    //This is the important part here
    <?php
    //Put Category 3 items on page 19 (My second page of blog posts)
     if(is_page('19')){query_posts("cat=3");}
    //Remove Category 3 items from page 8 (My Home Page)
     elseif(is_page('8')){query_posts("cat=-3");}
    ?>
    //That is all there is to it and it can be done for multiple pages
    
    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    <div class="post" id="post-<?php the_ID(); ?>">
    <h2><?php the_title(); ?></h2>
            <div class="entry">
            <?php the_content('<p class="serif">Read the rest of this page &raquo;</p>'); ?>

    And they can’t make this functionality part of the product! Argh!!!

    The “Exclude” was not working for me until I activated and then deactivated the “Frontpage Exclude Categories” plug-in. Not sure, maybe a fatfinger thing there.

    Thanks,
    Brad

    Ugh! I’m sorry, I’m not a programmer and don’t want to delve into themes, templates, etc. However, this is the best solution I have seen so far – thank you.

    I have the plug-in “Front Page Excluded Categories” which keeps the unwanted posts off of the main blog page. New Posts are assigned to unique Categories and I can get to those Categories via the built in WordPress URL https://www.site.com/?cat=5. But, how can I make a “Page” link to a Category Page? I see that I can edit a Page and give it a title and text, but how do I make a page a URL? When someone click the Page tab/link, how do I keep them from going to https://www.site.com/?page_id=15 and instead send them to https://www.site.com/?cat=6?

    I want to give featured writers their own pages and each writer will get a unique Category when they blog on my site. And no, I do not want to do this with Links.

    I hope this makes sense. I just really wish someone had a plug-in for this. Is the concept that insanely foreign? People have been asking for this for years.

    The “Category Page” plug-in requires template editing. It does have the “[catlist]” entry, but that just gives the headers of the posts in that category in a list, not the actually posts themselves. That plug-in author really needed a “[catposts]” option which could go in the text of a page. Then I would be done.

    Thanks,
    Brad

    Okay, so I deleted everything and did an SVN install of 2.7. I restored my DB and it still wouldn’t work.

    So, I created a brand new database/user, updated my wp-config.php file to contain the new credentials, and Imported my blog from an old export. Everything is working fine now. Something screwy in the upgrade.

    Same here. Any update? I cannot modify any users.

Viewing 7 replies - 1 through 7 (of 7 total)