Advertisement
Guest User

Untitled

a guest
Jun 23rd, 2017
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.36 KB | None | 0 0
  1. I am having a problem where my theme will return all posts, and not only posts in category "theme_propertycat". This works fine while logged in though. Wordpress 3.0.1.. can someone help :(
  2.  
  3. if($_REQUEST['list']=='favourite')
  4. {
  5. $totalpost_count = 0;
  6. $post_ids = get_usermeta($current_user->data->ID,'user_favorite_property');
  7. if(!$post_ids)
  8. {
  9. $post_ids[0]='0';
  10. }
  11. $querypost = array(
  12. 'post__in' => $post_ids,
  13. );
  14.  
  15. }else
  16. {
  17. $userID = $current_user->data->ID;
  18. //$all_pro_catids = get_property_all_cat_ids();
  19. $propertycat = get_cat_id_from_name(get_option('theme_propertycat'));
  20. $all_pro_catids = get_sub_categories($propertycat,'string');
  21. $querypost['author'] = $userID;
  22. $querypost['post_status'] = 'draft,publish';
  23. $querypost['cat'] = "$all_pro_catids";
  24. }
  25. $totalpost_count = 0;
  26. $limit = 1000;
  27. $querypost1=$querypost;
  28. $querypost1['showposts'] = $limit;
  29. query_posts($querypost1);
  30. if(have_posts())
  31. {
  32. while(have_posts())
  33. {
  34. the_post();
  35. $totalpost_count++;
  36. }
  37. }
  38.  
  39. global $posts_per_page,$paged;
  40. $limit = $posts_per_page;
  41. $querypost['showposts'] = $limit;
  42. $querypost['paged'] = $paged;
  43. query_posts($querypost);
  44. }
  45. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement