Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function my_custom_loop_2 ($category, $tag, $offset) {
- $args=array(
- // showposts has been replaced, use 'posts_per_page' instead
- // 'showposts' =>1,
- 'posts_per_page' => 3,
- // this has been replaced, use 'ignore_sticky_posts'
- // 'caller_get_posts' => 1,
- 'ignore_sticky_posts' => true,
- );
- if ($category) {
- $args['cat'] = $category;
- }
- if ($tag) {
- $args['tag'] = $tag;
- }
- if ($offset) {
- $args['offset'] = $offset;
- }
- $my_query = new WP_Query($args);
- // ... rest of function to output loop
- if( $my_query->have_posts() ) {
- while ($my_query->have_posts()) : $my_query->the_post(); ?>
- <div class="three-titles">
- <a href="<?php the_permalink() ?>" ><?php the_title(); ?></a></br>
- </div>
- <?php
- endwhile;
- } //if ($my_query)
- wp_reset_query(); // Restore global post data stomped by the_post().
- };
- <?php my_custom_loop_3(13, NULL, 1); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement