![]() |
![]() |
![]() |
||||
Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. |
![]() ![]() |
|
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
Thread Tools |
![]() |
#1 |
Confirmed User
Join Date: Feb 2003
Location: Dreamland
Posts: 1,685
|
Wordpress Gurus... Help Me Please... Exclude Category Posts!
I'm trying to exclude a category from displaying it's post on the pages of my blog... I can get it work but when I do you can't navagate to other older posts
![]() Here is the code I'm taking from wordpress help... Code:
<?php if (is_home()) { query_posts("cat=-3"); } ?> Code:
<div id="content"> (INSERTING ABOVE CODE ON THIS LINE) <?php if (have_posts()) : ?> <?php while (have_posts()) : the_post(); ?> Thanks in advance for the help ![]()
__________________
HaHaHa |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#2 |
Too lazy to set a custom title
Industry Role:
Join Date: Aug 2002
Posts: 55,359
|
you have to handle pagination
Code:
<?php if (is_home()) { $paged = (get_query_var(‘paged’)) ? get_query_var(‘paged’) : 1; query_posts(“cat=-3&paged=$paged”); } ?> |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#3 |
Confirmed User
Join Date: Feb 2003
Location: Dreamland
Posts: 1,685
|
Thanks fris... you rock
![]()
__________________
HaHaHa |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#4 |
Confirmed User
Join Date: May 2005
Location: The Porn Land
Posts: 1,414
|
there's also a plugin that does it all.
Look for "Simply Exclude" |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#5 |
Confirmed User
Join Date: Feb 2003
Location: Dreamland
Posts: 1,685
|
Just tryed that code Fris and I get
Parse error: syntax error, unexpected '=' Any idea what the problem could be?
__________________
HaHaHa |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#6 | |
Confirmed User
Industry Role:
Join Date: Jul 2001
Location: 127.0.0.1
Posts: 9,266
|
Quote:
Anyway, alternatively you may try this with the is_home approach to see if it works (change is_archive to true if needed): Code:
<?php $limit = 10; $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; query_posts('cat=-3&paged=$paged' . '&posts_per_page=10' .'showposts=' . $limit . '&paged=' . $paged); $wp_query->is_archive = false; $wp_query->is_home = true; ?>
__________________
This post is endorsed by CIA, KGB, MI6, the Mafia, Illuminati, Kim Jong Il, Worldwide Ninjas Association, Klingon Empire and lolcats. Don't mess around with it, just accept it and embrace the truth |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#7 |
Confirmed User
Industry Role:
Join Date: Jul 2001
Location: 127.0.0.1
Posts: 9,266
|
aaah, now that I take a closer look to the code fris posted I see the problem. Instead of copy/pasting the code as fris posted, do it like this:
Code:
<?php if (is_home()) { $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; query_posts("cat=-3&paged=$paged"); } ?>
__________________
This post is endorsed by CIA, KGB, MI6, the Mafia, Illuminati, Kim Jong Il, Worldwide Ninjas Association, Klingon Empire and lolcats. Don't mess around with it, just accept it and embrace the truth |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#8 |
Confirmed User
Join Date: May 2005
Location: The Porn Land
Posts: 1,414
|
jeeez, did u just miss that there's a ready made plugin - talk about stubborn
![]() |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#9 |
Too lazy to set a custom title
Industry Role:
Join Date: Aug 2002
Posts: 55,359
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#10 | |
Confirmed User
Join Date: Feb 2003
Location: Dreamland
Posts: 1,685
|
Quote:
![]()
__________________
HaHaHa |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#11 | |
Confirmed User
Join Date: Feb 2003
Location: Dreamland
Posts: 1,685
|
Quote:
I didn't miss it but I'd rather use plugins for the big stuff rather then bloat my blog with a bunch of plugins... especially when it only a few words of code and some help to get it working right!
__________________
HaHaHa |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#12 |
Confirmed User
Join Date: May 2005
Location: The Porn Land
Posts: 1,414
|
sowwy - my bad
![]() |
![]() |
![]() ![]() ![]() ![]() ![]() |