WordPress Question Answers Themes

There are some wordpress themes available which you can use to create a Question answers website.

Templatic – Answers theme

[button link=”http://wptuts.info/premiumthemes/answers” color=”purple”]Demo[/button] [button link=”http://wptuts.info/premiumthemes/answers” color=”lightblue”]Download[/button]

ElegantThemes – Askit theme

[button link=”http://wptuts.info/premiumthemes/elegantthemes” color=”purple”]Demo[/button] [button link=”http://wptuts.info/premiumthemes/elegantthemes” color=”lightblue”]Download[/button]

WordPress Accidentally changed site URL

In my previous project accidentally changed site url in the wordpress gerneral settings tab. As i don’t have wordpress admin login details i added following lines in the wp-config.php file to change the WP_HOME and WP_SITEURL.

Just add following lines inside the wp-config.php file inside PHP tag.

define('WP_HOME', 'http://' . $_SERVER['SERVER_NAME']);
define('WP_SITEURL', 'http://' . $_SERVER['SERVER_NAME']);

WordPress Conditional Tags

On most situation in a wordpress theme you want to display content on the basis of page. Like display a slider only on home page or display a 468×60 banner only on single post page.

In such situations wordpress conditional tags are used to display content on the basis of the conditional tags.

So if you want to display my wordpress content slide plugin on home page and this home page is using default page template.

then you have to add following code

if(function_exists('wp_content_slider')) { wp_content_slider(); }

so after that slider will be added only on home page.

All WordPress Conditional Tags


For more details check WordPress Conditional tags
Hire WordPress Expert for your website.

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.

$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 />';


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. 


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