Advertisement
Guest User

Untitled

a guest
Jul 5th, 2015
201
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.48 KB | None | 0 0
  1.     function TEST($offset)
  2.     {
  3.         $total_article_query = new WP_Query(array(
  4.             'category_name'=>get_the_title(),
  5.             'post_type' => 'post',
  6.             ));
  7.  
  8.      echo"total articles: $total_article_query->found_posts" . " offset: $offset";
  9.  
  10.         if ($offset = ($total_article_query->found_posts - 1))
  11.         {
  12.             echo
  13.             $nombrePosts = 1;
  14.         }
  15.         else if ($offset < ($total_article_query->found_posts - 1))
  16.         {
  17.             $nombrePosts = 2;
  18.         }
  19.         echo "nombre posts: $nombrePosts";
  20.         return $nombrePosts;
  21.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement