Activity Stream
48,167 MEMBERS
61095 ONLINE
besthostingforums On YouTube Subscribe to our Newsletter besthostingforums On Twitter besthostingforums On Facebook besthostingforums On facebook groups

Results 1 to 3 of 3
  1.     
    #1
    Banned

    Exclamation [Tutorial] - How to Keep your WP Blog Homepage Clean!

    [Tutorial] - How to Keep your WP Blog Homepage Clean!
    Im using this method in my blog WRZBlog.net to post XXX Uploads and still have a clean homepage. (ie:without XXX Posts)

    These two lines of code basically use the WordPress query_posts() function to exclude posts in a certain category. The first line of code fixes the pagination issue of all posts being displayed on all pages. Again, let’s say that we want to exclude all posts from the category with an ID of 8 from our index page.
    Simply place the following code in your index.php file before this line

    Code: 
    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>....
    Code: 
    <?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
    query_posts("cat=-8&paged=$paged"); ?>
    Issues with this method:
    This method will remove posts that are ONLY in the excluded category. If a post is in the excluded category as well as another category they will still show up on the home page.
    xfernanx Reviewed by xfernanx on . [Tutorial] - How to Keep your WP Blog Homepage Clean! - How to Keep your WP Blog Homepage Clean! Im using this method in my blog WRZBlog.net to post XXX Uploads and still have a clean homepage. (ie:without XXX Posts) These two lines of code basically use the WordPress query_posts() function to exclude posts in a certain category. The first line of code fixes the pagination issue of all posts being displayed on all pages. Again, let’s say that we want to exclude all posts from the category with an ID of 8 from our index page. Simply place Rating: 5

  2.   Sponsored Links

  3.     
    #2
    Member
    Thank you Will try this and report back !

  4.     
    #3
    Banned
    ^ You welcome mate

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. LE with PR3 Tutorial Blog
    By Rox in forum Link Exchange
    Replies: 7
    Last Post: 26th Feb 2012, 10:54 AM
  2. Replies: 0
    Last Post: 23rd Feb 2012, 01:29 AM
  3. [Tutorial] How to set up a Blog/Warez Blog [Includes SEO]
    By Laz0r in forum Tutorials and Guides
    Replies: 14
    Last Post: 7th Feb 2012, 04:58 PM
  4. [Tutorial] Start your own scene blog
    By p2p4ever in forum Tutorials and Guides
    Replies: 47
    Last Post: 10th Nov 2011, 12:56 PM
  5. [Tutorial] How to enable post via XML-RPC in your WordPress blog
    By kundurocks in forum Webmaster Resources
    Replies: 2
    Last Post: 5th Jun 2011, 04:30 AM

Tags for this Thread

BE SOCIAL