milardovich

Wordpress - getTratamientos

Jun 3rd, 2014
326
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.44 KB | None | 0 0
  1. function getTratamientos() {
  2.     $tratamientos = new WP_Query( 'post_parent=51');
  3.     if ( $tratamientos->have_posts() ) {
  4.         while ( $tratamientos->have_posts() ) {
  5.             echo "<div>";
  6.             echo "<h3>".$tratamientos->post_title."</h3>";
  7.             echo "<p>".$tratamientos->get_the_excerpt()."</p>";
  8.             echo "<a href=\"".$tratamientos->get_page_link()."\">[Seguir leyendo]</a>";
  9.             echo "</div>";
  10.         }
  11.     }
  12. }
  13. add_shortcode('tratamientos','getTratamientos');
Advertisement
Add Comment
Please, Sign In to add comment