Unique Single Post Templates for Different Categories

Single Post Templates

Hi learner how are your In this web developers resources I will inform you how to set Unique Single Post Templates for Different Categories. Here is an easy way to display custom post styles depending on the post’s category. With the following code, each single-view post will be displayed according to a template that is specific…

Remove Admin Bar Link For Non Administrators

Remove Admin Bar WordPress

In the WordPress Dashboard, besides the main menu on the sidebar, you will also find a couple of menu links at the top. You can remove admin bar link from specific roles or users. This snippet below will remove the menu in the admin bar for users who aren’t an Administrator – adjust accordingly. Add…

Display Recent Posts with Thumbnails in WordPress

Display Recent Posts with Thumbnails in WordPress

In this tutorial I will explain how to display recent post with thumbnails in WordPress sidebar, footer or other place. Especially where you want. This tutorial will help you avoiding plugins to display recent posts with thumbnails. After complete the below steps your recent post sidebar widgets will like the below image. Let’s started! Setp 1:…

Adding Post Thumbnail To Your Rss

Most WordPress websites use th featured thumbnail image to show an image in posts and post excerpts. Unfortunately, WordPress does not show these images in the RSS feed. By adding this function to your functions.php file you can display a featured image in the RSS feed if the post has one. function rss_post_thumbnail($content) { global…

Exclude Category From Feeds

By adding this code to your functions.php file you can posts from certain categories from your feeds. This is particular useful for those who use post formats and don´t want to include quotes and links etc in your main feed. // custom feed query function customFeedquery($query) { if(is_feed()) { $query->set(‘cat’,’-8′); // exclude category 8 return…

Create A Login Form Shortcode For Your WordPress Blog

Once you’ve added this to your functions.php file, you can add a login form to any post or page by inserting the shortcode [devpress-login-form]. function devpress_login_form_shortcode() { if ( is_user_logged_in() ) return ”; return wp_login_form( array( ‘echo’ => false ) ); } function devpress_add_shortcodes() { add_shortcode( ‘devpress-login-form’, ‘devpress_login_form_shortcode’ ); } add_action( ‘init’, ‘devpress_add_shortcodes’ );

Display The Number Of Comments By Author

A great function that lets you show how many comments each author has in the comments section of your page. Once you have added the function below to your functions.php template you can display the number of comments for each author by calling author_comment_count(); anywhere inside the comments loop in your comments.php template. function author_comment_count(){…

Shortcode To Display Youtube Thumbnail in WordPress

Insert YouTube videos into your content easily with shortcodes with this cool snippet. /* Shortcode to display youtube thumbnail on your wordpress blog. Usage: [youtube_thumb id=”VIDEO_ID” img=”0″ align=”left”] VIDEO_ID= Youtube video id img=0,1,2 or 3 align= left,right,center */ function wp_youtube_video_thumbnail($atts) { extract(shortcode_atts(array( ‘id’ => ”, ‘img’ => ‘0’, ‘align’=>’left’ ), $atts)); $align_class=’align’.$align; return ‘<img src=”http://img.youtube.com/vi/’.$id.’/’.$img.’.jpg”…

Set Maximum Title Length For WordPress Posts

Ensure authors don’t use extra long page titles by limiting the number of words that can be used. The code needs to be added to your functions.php template. function maxWord($title) { global $post; $title = $post->post_title; if (str_word_count($title) >= 10 ) //set this to the maximum number of words wp_die( __(‘Error: your post title is…

Delay Posts Being Published To Your RSS Feed

When this function is added to your functions.php template, you can delay your posts being published to your RSS feed. Change the $wait variable to change the number of minutes before posts are pushed to your feed. function publish_later_on_feed($where) { global $wpdb; if ( is_feed() ) { // timestamp in WP-format $now = gmdate(&lsquo;Y-m-d H:i:s&rsquo;);…