query_posts and conditional tag tests?
-
I’m having trouble getting a conditional test to work as it should, i’ve included the part of the code that seems to be relevant bellow, if the ‘Category_Cloud_Mini’ function was not there then the conditional test works, if the function is in the page before the test then every page tests as the ‘home’ page, including single & category pages,
assuming that it’s the ‘query_posts’ thing that’s causing the problem, i’d be grateful if anyone could tell me why its causing the conditional test to go wrong?
thanks for any help with this,
function Category_Cloud_Mini() { foreach((query_posts('showposts=25')) as $post) { } } Category_Cloud_Mini();followed by:
if (is_home()) { echo "ON HOME PAGE"; } elseif (is_single()) { echo "ON SINGLE PAGE"; } elseif (is_category()) { echo "ON CATEGORY PAGE"; }
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
The topic ‘query_posts and conditional tag tests?’ is closed to new replies.