Advertisement
Guest User

Untitled

a guest
Sep 3rd, 2019
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.80 KB | None | 0 0
  1. <?php
  2. $allProjectArgs = array(
  3.     'post_type' => 'project',
  4.     'post_status'=> 'publish',
  5.     'posts_per_page'=> -1,
  6.     'orderby' => 'favorit_users',
  7.     'order' => 'DESC',
  8.     'meta_query' => array(
  9.         'relation' => 'AND',
  10.             array(
  11.                 'key' => 'project_users',
  12.                 'value' => '"'.get_current_user_id().'"',
  13.                 'compare' => 'NOT LIKE'
  14.             ),
  15.             "favorit_users" => array(
  16.                 'key' => 'favorite_users',
  17.                 'value' => '"'.get_current_user_id().'"',
  18.                 'compare' => 'LIKE'
  19.             ),
  20.         ),
  21.     );
  22. $allProjectQuery = new WP_Query($allProjectArgs);
  23.  
  24. while($allProjectQuery->have_posts()) :  $allProjectQuery->the_post();
  25.  
  26.     ?>
  27.         <li><?php the_title(); ?></li>
  28.  
  29.     <?php
  30.  
  31. endwhile;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement