gotmoney
Member
Posted 10 months ago #
Hi there,
I have a problem with some of my theme's code. I know it's my theme because I tried another theme out and the problem went away. The thing is I bought a custom theme and do not wish to change it and have the coding problem sorted out.
http://snipt.org/xlUi - is my index.php
I also have an included file featured.php that has a similar code in it.
This is an adult site so I will not post the URL to it (you can find it in the index.php file I've shared).
If you could help, it would really make my day. I have looked everywhere and anything I try I can't replace said code and have it work.
Thanks.
line 16 of your code:
query_posts('cat=-20');
try to change it ot:
global $query_string; query_posts($query_string . '&cat=-20');
http://codex.wordpress.org/Function_Reference/query_posts#Usage_Note
gotmoney
Member
Posted 10 months ago #
Hey thanks for the reply however that didn't seem to work :(.
Hmmm... this one is a noodle scratcher!
Try explicitly adding the 'paged' variable like this:
global $query_string;
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1; query_posts($query_string . '&cat=-20' . '&paged=$paged');
alternative:
line 16 of your code:
query_posts('cat=-20');
try to change it to:
query_posts('cat=-20&paged='.get_query_var('cat'));
gotmoney
Member
Posted 10 months ago #
Jomsky: Tried this and didn't do the trick :(
alchymyth: Tried this and the result was a broken listing (no posts found).
I appreciate you guys trying to help.. wonder what it could be?
my bad - what i really meant was:
query_posts('cat=-20&paged='.get_query_var('paged'));
@jomsky
your idea is right - just the syntax (single quotes and strings in php) needs to be adapted:
query_posts($query_string . '&cat=-20' . '&paged='.$paged);
or
query_posts($query_string . "&cat=-20&paged=$paged");
gotmoney
Member
Posted 10 months ago #
Hey still isn't working. What a bugger eh?
Hey, so the index.php that I pasted earlier also includes featured.php which has similar lines of code:
http://codepad.org/6teg10Xl
keep the index.php with the latest changes; and try to add wp_reset_query(); after the endif; of featured.php
gotmoney
Member
Posted 10 months ago #
Added modified codes but still gives me the same return :(
gotmoney
Member
Posted 10 months ago #
Anyone else want to take a stab at it? It would really make my day :)
gotmoney
Member
Posted 10 months ago #
http://wordpress.org/support/topic/custom-theme-problem?replies=9
This is the same problem I'm having, anyone know how I can change it properly to make it work?
Thanks.
gotmoney
Member
Posted 10 months ago #