Guest User

Multi Categorie WP II

a guest
Sep 16th, 2015
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.68 KB | None | 0 0
  1. function get_post_by_cat($cat_name,$orderby,$order)
  2.     {
  3.      printf("<div class='post_box'>");
  4.      $list = query_posts('category_name='.$cat_name.'&orderby='.$orderby.'&order='.$order);
  5.      //$list = query_posts( array( 'category__and' => array(3,19), 'posts_per_page' => 5, 'orderby' => 'title', 'order' => 'DESC' ) );
  6.      printf("%d Beiträge die aus der Kategorie %s gefunden wurden.",count($list->posts),$cat_name);
  7.    
  8.      for($i=0;$i<count($list);$i++)
  9.       { echo "<br>".get_the_post_thumbnail( $list[$i]->ID, 'thumbnail' );
  10.         printf("<post_title> <a href='%s'>%s </a><info>%s</info> </post_title>",
  11.         $list[$i]->guid,$list[$i]->post_name,$list[$i]->post_content);
  12.        
  13.       }
  14.      printf("</div>");
  15.     }
Advertisement
Add Comment
Please, Sign In to add comment