Modify recent post sidebar to show post thumbs with out plugins

HERE IS THE SOLUTION /** * Extend Recent Posts Widget * * Adds different formatting to the default WordPress Recent Posts Widget */ Class My_Recent_Posts_Widget extends WP_Widget_Recent_Posts { function widget($args, $instance) { if ( ! isset( $args[‘widget_id’] ) ) { $args[‘widget_id’] = $this->id; } $title = ( ! empty( $instance[‘title’] ) ) ? $instance[‘title’] : … Read more

Display list of most used tags in the last 30 days

The problem was that the SQL query code was getting the term_taxonomy_id, not the actual tag ID. I added an additional INNER JOIN using the term_taxonomy table to get the term_id. This seems to work, but if a mod can improve this, please do! <ul id=”footer-tags”> <?php $wpdb->show_errors(); ?> <?php global $wpdb; $term_ids = $wpdb->get_col(” … Read more

Code for Recent Posts Widget

The default Recent Posts Widget code is in includes/default-widgets.php but you should not be hacking Core code. Copy that function to your theme’s functions.php, rename it, and create your own customized widget.

How to display last 3 posts (recent posts) in a static page?

I usually use this approach: wrong approach <?php query_posts( array( ‘category_name’ => ‘news’, ‘posts_per_page’ => 3, )); ?> <?php if( have_posts() ): while ( have_posts() ) : the_post(); ?> <?php the_excerpt(); ?> <?php endwhile; ?> <?php else : ?> <p><?php __(‘No News’); ?></p> <?php endif; ?> With the help of @swissspidy the correct way is … Read more