Show recently updated posts in sidebar
-
Hello there, I have been trying to show 5 recently modified posts in my wordpress blog but the code doesn’t seem to work. I add this code in the ‘text’ widget in the sidebar but it doesn’t work.
Here is the code:
<?php $args=array( 'orderby'=> 'modified', 'order' => 'ASC', 'post_type' => 'post', 'post_status' => 'publish', 'posts_per_page' => 5, 'caller_get_posts'=> 1 ); $my_query = null; $my_query = new WP_Query($args); if( $my_query->have_posts() ) { while ($my_query->have_posts()) : $my_query->the_post(); ?> <p><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></p> <?php endwhile; } wp_reset_query(); // Restore global post data stomped by the_post(). ?>
Any idea what’s wrong here?
Here is the link to my website: https://androidgameapks.com/the-simpsons-tapped-out-cheat-apk-unlimited-money-xp-and-donuts/
Notice the code on the right sidebar on the top
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Show recently updated posts in sidebar’ is closed to new replies.