Showing posts from January, 2013

How to display recent with thumbnail by specific category

Paste this below code where you want to show recent post with thumbnail

$the_query = new WP_Query('cat=3&showposts=5&orderby=post_date&order=desc');
while ($the_query->have_posts()) : $the_query->the_post(); ?>
<div style="margin-bottom: 2px;">
<?php the_post_thumbnail(array(50,50), array ('class' => 'alignleft')); ?>
<a title="<?php the_title(); ?>" href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a>
<?php the_excerpt(); ?>
<div class="clear"></div>

<?php endwhile; ?>
<?php wp_reset_query(); ?>

You can neglect<?php the_excerpt(); ?>  if you want to show only post title with thumbnail

How to display related post by category

Paste this below code into post-single.php 
    <!--start of related post-->  
* @Author: Boutros AbiChedid
* @Credit:
* @Date:   May 24, 2011
* Tested on WordPress version 3.1.2
* @Description: Code that shows other "Related Posts" to a post
* based on ALL COMMON categories.

//Retrieve the list of categories for a post.
$categories = get_the_category($post->ID);

//If categories exist for the post.
if ($categories) {
    $category_ids = array();

    //retrieve the category_ids for the post.
    foreach($categories as $each_category)
        $category_ids[] = $each_category->term_id;

    //WP_Query arguments.
    $args = array(
        'category__in' => $category_ids, //An array of category IDs to be included.
        'post__not_in' => array($post->ID), /…

How to move website to a new server or host

It is not easy to  move a website to a new server or host. But after reading this step by step tutorial, I'm sure that it will be easier to all of you. Just read these all of steps carefully. I think that you can change your server / host very easily. 
Step1: Take backup of your old server/hosting cpanel.
In case of wordpress site:  If you have the wordpress site then you can also take a backup of your contents. Go to Tools menu of your Dashboard. Click on Export and select all contents. Download this. This download not required but for safety. 
Step2:  In your old Cpanel go to PHP MyAdmin. 

Select the database you want to download. 

Click on the Export Box/menu. 
Here select all,
Check box  Add DROP TABLE / VIEW / PROCEDURE / FUNCTIONFormat should be SQL  SQL and
check the box Save as file

Click on the save button. download  will start
Congratulations! you have done half of your work.The download file will be yourdatabasename.sql . 
Step3: Login to your news hosting cpanel. Remember …

Change Default Gravatars in Wordpress

If you want to show different Gravatars for diffident user then tell your user to Create an account in 

* Use the mail id that you want to use for these purpose

*Choose the image from your Computer/ from internet/ previously uploaded. In this way click on next step

*After you've complete your image will appear as your gravatar whenever you post on your own blog or post a comment by using this mail ID

*If you want to to change your default Gravatars then you need to change some code in your functions.php file. Remember that , this default gravatar can be seen only that time if your user do not have any gravatar from for his used mail Id

*Use this code above the last line of your functions.php file

/* Powerusers Gravatar /* ----------------------------------------------*/ add_filter( 'avatar_defaults', 'newgravatar' ); function newgravatar ($avatar_defaults) { $myavatar = get_bloginfo('template_directory') . '/ima…

Custom Logo to Wordpress Login Page

Add this code to your functions.php file . Preferable to add just before the last line (before ? line ) 

function my_custom_login_logo() {
    echo '<style type="text/css">
        h1 a { background-image:url( !important; }

add_action('login_head', 'my_custom_login_logo');

N.B Colored Url will be changed by your url

Technic 2: 
You can simply change the Logo  image from wp-admin\images
This is more simple way without  changing any code.

Technic 3:
You can also use plugin for this purpose. You can download Login Logo plugin from here

Advance Technic: If you want to change the title of your custom Logo the you need to change the code present in wp-login.php

Find out the code below:

} else {
$login_header_url   = __( '' );
$login_header_title = __( 'Powered by WordPress' );

Change this code by your code, sample below:

} els…

Slide out Facebook Like Box

Just page this code where you want to show : ( You can add it to your sidebar/ widget)
Check Demo:,

<script src=""></script>
<script>(function(d,s, id) {
  var js, fjs = d.getElementsByTagName(s)[0];
  if (d.getElementById(id)) return;
  js = d.createElement(s); = id;
  js.src = "//";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));

$(document).ready(function () {
bottompx = "0px";
$('#facebook_likebox').slideDown(1500).css({bottom: bottompx});
//facebook likebox
function closefaceboxlike(){
<div id="facebook_likebox" style="float: left;
 position: fixed;
 left: 5px;
margin-bottom: 10px; border: 2px solid rgb(205, 219, 228);
background-color: #888fff; z-index: 10; bottom: 0px;">

Allow user to change font size- Fluid Text Resizer

Step 1: Add the following code to the <HEAD> section of your web page:

<!-- font -->
<style type="text/css">

.controlstyle a{ /*links inside DIV sizecontroldiv*/
float: right;

.controlstyle a img{ /*image links inside DIV sizecontroldiv*/
border-width:0;float: right;

.controlstyle a.selectedcontrol img{ /*selected control's image*/
border-bottom:4px solid darkred;


<script type="text/javascript" src=""></script>

<script type="text/javascript" src="">

* Fluid Text Resizer- © Dynamic Drive DHTML code library (
* Visit for hundreds of DHTML scripts
* This notice must stay intact for legal use


Free Social Traffic pop for Website

System 1
Step1: Add a HTML/JavaScript Gadget.

Step2: Copy Down Below Code after Replacing Facebook URL . 

<link type="text/css" rel="stylesheet" href="">
<script src=""></script>
<script src=""></script>
<script src="" type="text/javascript">
<script type="text/javascript" src="">
<script>$(document).ready(function(){                      $().socialTrafficPop({timeout: 30,                    title: "Welcome To ",
message: 'Please Like And  <em>Help Us To Grow</em>! ',        …

Showing Date in Bangla to your Website

This is for Showing Hijri Date in Bangla:

Example1:   ৪ রবিউল আউয়াল, ১৪৩৪ হিজরীর
<script type="text/javascript" src=""></script>

Example2:  আজ ৪ রবিউল আউয়াল, ১৪৩৪ হিজরী
<script type="text/javascript" src=""></script>
Example3   ইয়াওমুল খামীসি, ৪ রবিউল আউয়াল, ১৪৩৪ হিজরী
<script type="text/javascript" src=""></script>
Example4:  আজ ৪ রবিউল আউয়াল, ১৪৩৪ হিজরী, ইয়াওমুল খামীসি

    <script type="text/javascript" src=""></script>

This is for Showing English Date in Bangla:

Example1:   আজ ১৭ জানুয়ারি ২০১৩ খ্রিষ্টাব্দ, বৃহস্পতিবার
<script type="text/javascript" src=""&…

Adding Translator for Site

Just Paste this code to your site where  you want to show the translator :

<script language="JavaScript" src=""></script>
<SCRIPT language=JavaScript type=text/JavaScript>translation_flags_g();</SCRIPT>

Adding Snow Effect in Website

Just pate this code to your site :

<script type="text/javascript">

* Snow Effect Script- By Altan d.o.o. (
* Visit Dynamic Drive DHTML code library ( for full source code
* Last updated Nov 9th, 05' by DD. This notice must stay intact for use

  //Configure below to change URL path to the snow image
  var snowsrc=""
  // Configure below to change number of snow to render
  var no = 10;
  // Configure whether snow should disappear after x seconds (0=never):
  var hidesnowtime = 0;
  // Configure how much snow should drop down before fading ("windowheight" or "pageheight")
  var snowdistance = "pageheight";

///////////Stop Config//////////////////////////////////

  var ie4up = (document.all) ? 1 : 0;
  var ns6up = (doc…

Floating Facebook like button

<!DOCTYPE html>
<link rel="stylesheet"

href="" />

<script type="text/javascript"


<script src="">

* Drop In Content Box (c) Dynamic Drive (
* This notice MUST stay intact for legal use
* Visit for this script and 100s more.



var dropinbox1=new dropincontentbox({

''], //#id of DIV to

show if defined inlin…

Floating Add Create

Step 1: Add the following code into the <HEAD> section of your page:

<style type="text/css">

border: 1px solid black;
padding: 2px;
background-color: lightyellow;
width: 620px;
visibility: hidden;
z-index: 100;


<script type="text/javascript">

* Floating Top Bar script- © Dynamic Drive (
* Sliding routine by Roy Whittle (
* This notice must stay intact for legal use.
* Visit for full source code

var persistclose=0 //set to 0 or 1. 1 means once the bar is manually closed, it will remain closed for browser session
var startX = 30 //set x offset of bar in pixels
var startY = 5 //set y offset of bar in pixels
var verticalpos="fromtop" //enter "fromtop" or "frombottom"

function iecompattest(){
return (document.compatMode &&a…

MY Bookmarks