WordPress
There are 50 posts filed in WordPress (this is page 2 of 5).
Year Based Post Listing Timeline in WordPress
Somehow visited this site and liked the timeline
So I made my own script (still it can be improved)
What you need to do is make a custom page template in wordpress and write the following code in the loop. May be I will release it as a plugin as shortcode.
Demo: See it in action here
Thanks
Search User by Display Name in WordPress Sitewide
In wordpress in backend or if you use wordpress user query ‘WP_User_Query’ by default it will not search by display_name even if you add display_name in “search_columns” field of WP_User_Query
So, this can be achieved by this small filter https://gist.github.com/manchumahara/9910185 (after add this code now if you search in your wordpress admin panel for user with their display name it will work)
ref: https://codex.wordpress.org/Class_Reference/WP_User_Query
Author Archive Widget in WordPress
In wordpress we can show the post archive widget easily but there is no easy way to show author archive widget. This small code snippet will help to show author archive widget in author page.
Thanks
Displaying Post edit link in wordpress properly
Sometimes we need to play post edit link for admin, editor or author himself. To place the edit link on frontend it’s need to take care a bit so that the edit link is not visible to any unauthorized user. So my choice is showing the edit link who has other post edit permission and the author himself.
Category Post Count in WordPress (Custom Taxonomy with Custom Post Type)
Let me explain my need in short:
I want to show post count for any category/any custom taxonomy registered for any custom post type. I searched wordpress forums and in google, found some solutions using
- http://wordpress.org/support/topic/category-post-count-2?replies=6
- http://wordpress.org/support/topic/category-post-count?replies=6
- http://www.intechgrity.com/get-post-count-of-a-category-including-sub-categories-in-wordpress/#
- http://www.web-templates.nu/2008/09/21/get_category_count/index.html
Nothing helped me such way, so I managed my own way with my little knowledge.
wp_get_productcat_postcount($id, $posttype = ‘product’, $taxname = ‘product_cat’)
$id = category or any taxonomy id(term id)
$posttype = post type name, example: post, page, or any custom post type
$taxname = taxonomy name or any category type name, for joomla default taxonomy it will category, post_tag, nav_menu, link_category, post_format, but we can use any custom taxonomy name as I used ‘product_cat’ which is used with custom post type ‘product’ , post type name.
[code lang=”php”]
function wp_get_productcat_postcount($id, $posttype = ‘product’, $taxname = ‘product_cat’) {
$result = wp_cache_get( ‘taxpostcount’.$id, ‘cbtaxpostcount’ );
//var_dump($resul);
if ( false === $result ) {
$args = array(
‘post_type’ => $posttype,
‘post_status’ => ‘publish’,
‘posts_per_page’ => -1,
‘tax_query’ => array(
‘relation’ => ‘AND’,
array(
‘taxonomy’ => $taxname,
‘field’ => ‘id’,
‘terms’ => array( $id )
)
)
);
$query = new WP_Query( $args);
/*
echo ‘<pre>’;
print_r($query->post_count);
echo ‘</pre>’;
*/
$result = (int)$query->post_count;
$cacheresult = wp_cache_set( ‘taxpostcount’.$id, $result, ‘cbtaxpostcount’ );
//var_dump($cacheresult);
}
return $result;
}
[/code]
Note: As I used wordpress object cache for better performance.
Thanks for reading, any comment is appreciable.
Google Plus Comment for WordPress
Google Plus Introduced Social comment plugin(unofficially). so I just made a small shortcode based plugin for wordpress to test the baby.
BTW, I noticed about this from google plus.
Download from bellow:
[download id=”36″]
Demo:
Please check here .
Shortcode:
[gpluscomment]
For more technical people
'url' => '', // leave empty for current post
'width' => '500',
'js' => 1,
'showarchive' => false,
'showhome' => false
My Test results screenshots:
Showing custom taxonomy filter in custom post types in wordpress admin post listing

Please note that “this post is for them who knows custom post types and custom taxonomy in wordpress”
Isn’t the title enough to get what my article about ?
Let me paste the code what I did: I think I collected the basic code from somewhere and then edited as I need.
Continue reading
Hirarchycal Category or Custom Taxonomy Select or Radio list for wordpress

I think the post title “Hirarchycal Category or Custom Taxonomy Select or Radio list for wordpress” says all what I want to say. I was just thinking to make admin like category or term widget to use on front end or theme or other places. So I took the code from wordpress core and used it. So here I am sharing the code with all.
Continue reading
āĻāϏā§āύ āĻāϝāĻŧāĻžāϰā§āĻĄāĻĒā§āϰā§āϏā§āϰ āĻĄā§āϝāĻžāĻļ āĻŦā§āϰā§āĻĄ āĻĒāϰāĻŋāϏā§āĻāĻžāϰ āĻāϰāĻŋ
āĻāϝāĻŧāĻžāϰā§āĻĄāĻĒā§āϰā§āϏā§āϰ āĻāĻĄāĻŽāĻŋāύ āĻĒā§āϝāĻžāύā§āϞ⧠āϞāĻāĻŋāύ āĻāϰāϞā§āĻ āĻāĻāĻāĻžāĻĻāĻž āĻŦāĻā§āϏ āĻāϏ⧠āĻšāĻžāĻāĻŋāϰ āĻšāϝāĻŧāĨ¤ āϝāĻĻāĻŋāĻ āϏā§āĻā§āϰāĻŋāύ āĻ āĻĒāĻļāύ āĻĨā§āĻā§ āϏā§āĻā§āϞ⧠āϏāĻšāĻā§ āϤāĻžāĻĄāĻŧāĻžāύ⧠āϝāĻžāϝāĻŧ āĻāĻŋāύā§āϤ⧠āϝāĻĻāĻŋ āĻāĻŽāύ āĻšāϝāĻŧ āĻāĻĄāĻŽāĻŋāύ āύāĻŋāĻā§āĻ āĻĄā§āϝāĻžāĻļāĻŦā§āϰā§āĻĄ āĻĒāϰāĻŋāϏā§āĻāĻžāϰ āĻāϰ⧠āϰā§āĻā§ āĻĻāĻŋāϞā§āύ āύāϤā§āύ āϏāĻĻāϏā§āϝā§āϰ āĻāύā§āϝāĨ¤ āϤāĻŦā§ āĻāĻ āĻĒāϰāĻŋāϏā§āĻāĻžāϰ āĻāϰ āĻāĻžāĻāĻāĻž āĻāĻŽāϰāĻž āĻāϰāĻŦā§ āϏāĻžāĻŽāĻžāύā§āϝ āĻāĻŋāĻā§ āĻĒāĻŋāĻāĻāĻāĻĒāĻŋ āĻā§āĻĄāĻŋāĻ āĻāϰā§āĨ¤
āϧāĻžāĻĒ āĻāĻāĻ āĻĒā§āϰāĻĨāĻŽā§ āĻāĻĒāύāĻžāϰ āĻĨā§āĻŽā§āϰ functions.php āĻĢāĻžāĻāϞ⧠āĻ ā§¨āĻāĻŋ āĻĢāĻžāĻāĻļāύ āϞāĻŋāĻāϤ⧠āĻšāĻŦā§āĨ¤ āĻŽāύ⧠āϰāĻžāĻāĻŦā§āύ āĻĒā§āϞāĻžāĻāĻŋāύ āĻāϰ āĻā§āĻĄāĻā§āϞ⧠āĻāĻžāĻāϞ⧠functions.php āĻĢāĻžāĻāϞā§āĻ āϞā§āĻāĻž āϝāĻžāϝāĻŧāĨ¤ āϤāĻžāĻšāϞ⧠āĻļā§āϰ⧠āĻāϰāĻž āϝāĻžāĻāĻ
[code language=”php”]
//Define the function which unsets the boxes
function remove_dashboard_widgets() {
global $wp_meta_boxes;
myprint_r($wp_meta_boxes);
/*
//unset($wp_meta_boxes[‘dashboard’][‘normal’][‘core’][‘dashboard_right_now’]);
# Remove plugins feed
unset($wp_meta_boxes[‘dashboard’][‘normal’][‘core’][‘dashboard_plugins’]);
unset($wp_meta_boxes[‘dashboard’][‘side’][‘core’][‘dashboard_plugins’]);
# Remove "WordPress News"
unset($wp_meta_boxes[‘dashboard’][‘normal’][‘core’][‘dashboard_primary’]);
unset($wp_meta_boxes[‘dashboard’][‘side’][‘core’][‘dashboard_primary’]);
unset($wp_meta_boxes[‘dashboard’][‘normal’][‘core’][‘dashboard_secondary’]);
unset($wp_meta_boxes[‘dashboard’][‘side’][‘core’][‘dashboard_secondary’]);
# Remove incoming links feed
unset($wp_meta_boxes[‘dashboard’][‘normal’][‘core’][‘dashboard_incoming_links’]);
unset($wp_meta_boxes[‘dashboard’][‘side’][‘core’][‘dashboard_incoming_links’]);
unset($wp_meta_boxes[‘dashboard’][‘side’][‘core’][‘dashboard_recent_drafts’]);
unset($wp_meta_boxes[‘dashboard’][‘normal’][‘core’][‘dashboard_recent_comments’]);
unset($wp_meta_boxes[‘dashboard’][‘side’][‘core’][‘dashboard_quick_press’]);
unset($wp_meta_boxes[‘dashboard’][‘normal’][‘core’][‘events_dashboard_window’]);
*/
}
// Now hook in to the action
add_action(‘wp_dashboard_setup’, ‘remove_dashboard_widgets’, 20, 0);
//better print_r function taken from
//http://stackoverflow.com/questions/1386331/php-print-r-nice-table
function myprint_r($my_array) {
if (is_array($my_array)) {
echo "<table border=1 cellspacing=0 cellpadding=3 width=100%>";
echo ‘<tr><td colspan=2 style="background-color:#333333;"><strong><font color=white>ARRAY</font></strong></td></tr>’;
foreach ($my_array as $k => $v) {
echo ‘<tr><td valign="top" style="width:40px;background-color:#F0F0F0;">’;
echo ‘<strong>’ . $k . "</strong></td><td>";
myprint_r($v);
echo "</td></tr>";
}
echo "</table>";
return;
}
echo $my_array;
}
[/code]
Continue reading