WordPress get all category ids

To get all the category id’s from current wordpress blog you have to use following function which returns an array of all the category id’s

<?php $all_category_ids=get_all_category_ids() ?>

after that you can fetch to retrieve all the category ids. even you can get category name for each category.

<?php
$category_ids = get_all_category_ids();
foreach($category_ids as $cat_id) {
  $cat_name = get_cat_name($cat_id);
  echo $cat_id . ': ' . $cat_name.'<br />';
}
?> 

Credits

WordPress Codex
Hire a WordPress Expert for your website to create wordpress themes

WordPress get Category id by name

By using following function you can get category id. Parameter for this function are category name

<?php $cat_id=get_cat_ID( $cat_name ) ?> 
/*
Parameters $cat_name=String category name
returns 0, if failure and ID of category on success. 
*/

Credits

Get Category Id By WordPress Codex
Hire a WordPress Expert for your website to create wordpress themes

WordPress Facebook like button

Facebook is most popular community website now. And latest trend is to add a facebook like button on your blog posts in this post I will show you how to add facebook like button on your blog posts.

Open your themes single.php file and add following code inside it where you want that button.

<iframe src="http://www.facebook.com/plugins/like.php?href=<?php echo urlencode(get_permalink($post->ID)); ?>&amp;layout=standard&amp;show_faces=false&amp;width=450&amp;action=like&amp;colorscheme=light" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:450px; height:25px"></iframe>

Hire a WordPress Developer for your website to create wordpress themes

WordPress Use shortcode outside post editor in theme files

WordPress added function called do_shortcode() using this function you can call wordpress shortcodes outside post editor and you can call shortcode in you wordpress theme .php files.

// Use shortcode in a PHP file (outside the post editor).
do_shortcode('[album]');

Credits

WordPress Functions
Hire a WordPress Expert for your website to create wordpress themes