Query Posts isnt working
-
In my functions.php file I have this
function get_posts_page() { global $wpdb; global $query_string; if(is_category()) { $cat = get_query_var('cat'); $catx = get_category($cat); $catname = $catx->cat_name; } query_posts("&post_status=publish&offset=".$_POST['off']."&category_name=".$catname); // The loop is here.. }
So it’ll query_posts and change the posts depending on what category you’re in. The is_category() bit isn’t working at all (I tried echoing $catname and nothing happened). Any ideas why? Do i need to add an action to this function to make it work or am I missing a global variable, or what?
- The topic ‘Query Posts isnt working’ is closed to new replies.