Guest User

Untitled

a guest
Dec 18th, 2018
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. add_shortcode('tela-anuncios-compras', 'tela_anuncios_compras');
  2.  
  3. function tela_anuncios_compras( $atts ) {
  4. $args = array(
  5. 'posts_per_page' => 2,
  6. 'paged' => $paged,
  7. 'post_type' => 'product',
  8. 'order' => 'ASC',
  9. 'orderby' => 'title',
  10. );
  11.  
  12. $query = new WP_Query($args);
  13.  
  14. while ($query -> have_posts()): $query->the_post();
  15. global $product, $post;
  16. echo "dados do item";
  17. endwhile;
  18.  
  19. echo '<div class="listings clearfix"><div class="nav-previous">' . get_next_posts_link( __( '<span class="meta-nav">&larr;</span> Older posts' ) ) . '</div><div class="nav-next">' . get_previous_posts_link( __( 'Newer posts <span class="meta-nav">&rarr;</span>' ) ) . '</div></div>';
  20.  
  21. wp_reset_query();
  22. }
Add Comment
Please, Sign In to add comment