How to Get Logged In User Information in WordPress

Are you looking for the best way to get logged in user information in WordPress? In the previous, post I shared with you how to check if a user is logged in and also how to find the role of logged in user. In this post, I want to extend this by explaining how to get logged in user information in WordPress.  WordPress comes with a function that helps in getting user information....

How to Apply jQuery UI Datepicker in WordPress

WordPress has changed a lot since version 3.8, especially the admin UI theme. Following the masses, the WordPress admin UI now looks flatter, removed of gradients and shadows. It means, if you have a built theme or plugin that used a customized UI, it is time for a makeover. As an example, here I have added Data Picker in the post editing screen. And as you can see below the calendar’s UI seems...

How to display recent posts in WP

More advanced WordPress users may want to add recent posts directly in their WordPress theme files. Of course, you should use a child theme for this so that when you update your theme, you don’t lose your changes. It’s always a good idea to create a backup before you edit your theme files. If anything does go wrong, you might want to take a look at our list of the most common WordPress errors and...

How to add WordPress Related Posts Without Plugins

One of the big advantages of using WordPress are the plugins. WordPress plugins cover almost anything you can imagine, from expanding your blog into a CMS, to adding nifty features and optimizing your blog for search engines – the possibilities are endless (and let’s not forget all the different themes out there). But by using too many plugins, you run the risk of clogging up your WordPress blog, and at the very...

Modify recent post sidebar to show post thumbs without plugins

/** * 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) { extract( $args ); $title = apply_filters('widget_title', empty($instance['title']) ? __('Recent Posts') : $instance['title'], $instance, $this->id_base); if( empty( $instance['number'] ) || ! $number = absint( $instance['number'] ) ) $number = 10; $r = new WP_Query( apply_filters( 'widget_posts_args', array( 'posts_per_page' => $number, 'no_found_rows' => true,...

Recent Posts Widget with Thumbnail – Without Plugins

In this post, we will see about showing Recent Posts Widget with Thumbnails in Sidebar. Copy-Paste the below code in sidebar.php after deciding the placement of your Recent Posts. I’ve added just before so that this recent posts gets displayed first in the sidebar followed by all the widgets that is chosen by us under Appearance’s Sidebar widget area. <?php $recent_posts = wp_get_recent_posts(); foreach( $recent_posts as $recent ){ &nbsp;&nbsp;&nbsp; if($recent['post_status']=="publish"){...

Filtering post or custom post type by a specific taxonomy term in the WordPress admin

This is a powerful little snippet to allow filtering your post or custom post type by a specific taxonomy term in the WordPress admin. In my use case I had a custom post type for ‘Team’ members. I then had a custom taxonomy called ‘Group’ that associated each member with one or more groups within the organization. The client wanted to be able to filter all Team members by Group...

How to Create Next & Previous Links On WordPress Posts

On many WordPress themes you see links at the bottom of single posts which direct you to the previous and next posts of the blog. So, in this short tutorial, I am going to show you how to use the built-in WordPress functions to create those links. There is a function for both the previous link and the next link, both of these functions should be used on a single post...