Make text bigger  Make text smaller  Toggle background color  Bookmark/Share


WORDPRESS FUNCTION: GET CATEGORY ID USING CATEGORY NAME

As usual, let’s begin by pasting a duty in your functions.php file: duty get_category_id($cat_name){ $term = get_term_by(’name’, $cat_name, ‘category’); lapse $term-> term_id; } Once we saved a file, only call a duty with your difficulty name as a parameter.

Read some-more here:
WordPress function: Get difficulty ID regulating difficulty name


Get Auto Caffeinated Content for Your WordPress Blog



HOW TO DISPLAY YOUR AVERAGE FEED READERS

As usual, a initial thing to do is to pulp a duty in your functions.php file: duty get_average_readers($feed_id,$interval = 7){ $today = date('Y-m-d', strtotime("now")); $ago = date('Y-m-d', strtotime("-".$interval." days")); $feed_url="https://feedburner.google.com/api/awareness/1.0/GetFeedData?uri=".$feed_id."&dates=".$ago.",".$today; $ch = curl_init(); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_URL, $feed_url); $data = curl_exec($ch); curl_close($ch); $xml = brand new SimpleXMLElement($data); $fb = $xml->feed->entry['circulation']; $nb = 0; foreach($xml->feed->children() as $circ){ $nb += $circ['circulation']; } lapse round($nb/$interval); } Once done, we can call a duty wherever we wish in your thesis files.

Read some-more from a strange source: 
How to arrangement your normal feed readers


Get Auto Caffeinated Content for Your WordPress Blog



ADD CATEGORIES OR TAGS TO POST PROGRAMATICALLY

The initial thing to do is to emanate an form of categories id. Once done, we simply have to make use of a wp_set_object() function, that take 3 parameters: The post id, an form of categories to supplement to a post, as good as a taxonomy sort (category in this example). $category_ids = array(4, 5, 6); wp_set_object_terms( $post_id, $category_ids, ‘category’); Adding tags to a post is intensely easy as well.

Here is a original:
Add categories or tags to post programatically


Get Auto Caffeinated Content for Your WordPress Blog

Get Auto Caffeinated Content for Your WordPress Blog



HOW TO PROGRAMATICALLY REMOVE WORDPRESS DASHBOARD WIDGETS

Simply pulp a following in to your functions.php file. The formula will mislay all dashboard widgets, so we should criticism lines associated to wigets you’d similar to to keep.

View post:
How to programatically mislay WordPress dashboard widgets


Get Auto Caffeinated Content for Your WordPress Blog



WORDPRESS HACK: DISPLAY POST THUMBNAIL IN YOUR RSS FEED

Simply pulp a following formula in your functions.php file. The post thumbnail should be manifest once we saved a file.

Go here to see a original:
WordPress hack: Display post thumbnail in your RSS feed


Get Auto Caffeinated Content for Your WordPress Blog



WORDPRESS HACK: REMOVE ADMIN NAME IN COMMENTS CLASS

This formula simply have to be pasted in your functions.php record to work: duty remove_comment_author_class( $classes ) { foreach( $classes as $key => $class ) { if(strstr($class, "comment-author-")) { unset( $classes[$key] ); } } lapse $classes; } add_filter( 'comment_class' , 'remove_comment_author_class' ); Thanks to C. Bavota for this engaging square of code! Looking for WordPress hosting

Original post: 
WordPress hack: Remove admin name in comments class


Get Auto Caffeinated Content for Your WordPress Blog



WORDPRESS HACK: INSERT COMMENTS PROGRAMATICALLY

The following formula can be pasted anywhere on your thesis files.

Read some-more here:
WordPress hack: Insert comments programatically


Get Auto Caffeinated Content for Your WordPress Blog



WORDPRESS HACK: GET POPULAR POSTS BY COMMENTS COUNT

Simply pulp a following formula where we wish to arrangement your many renouned posts to be displayed: $pop = $wpdb->get_results("SELECT id, post_title, comment_count FROM {$wpdb->prefix}posts WHERE post_type='post' ORDER BY comment_count DESC LIMIT 10"); <ul> foreach($pop as $post) : ?> <li> <?php relate $post->post_title; ?> </li> <?php endforeach; ?> </ul> Thanks to Neil Skoglund for this good square of code! Looking for WordPress hosting? Try WP Web Host

Here is a strange post:
WordPress hack: Get renouned posts by comments count


Get Auto Caffeinated Content for Your WordPress Blog



HOW TO DISPLAY TWITTER-LIKE “TIME AGO” ON YOUR WORDPRESS BLOG

The initial thing to do is to emanate a function. To do so, pulp a following in to your functions.php file: duty time_ago( $type = ‘post’ ) { $d = ‘comment’ == $type ? ‘get_comment_time’ : ‘get_post_time’; lapse human_time_diff($d(’U'), current_time(’timestamp’)) .

See strange here:
How to arrangement Twitter-like “time ago” on your WordPress blog


Get Auto Caffeinated Content for Your WordPress Blog

Pages