Posts

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


<?php
$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>
</div>

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

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-->  
    <?php
/********** CODE BLOCK2 (BASED ON ALL COMMON CATEGORIES) *********
* @Author: Boutros AbiChedid
* @Credit: http://bacsoftwareconsulting.com/blog/
* @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

Image
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

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


* 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 gravatar.com 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 gravatar.com 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

Technic1:
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(http://bestcareerbd.com/wp-content/uploads/2012/09/Untitled-4.png) !important; }
    </style>';
}

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   = __( 'http://wordpress.org/' );
$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:   JNnews24.combdnews24.com,

<script src="http://connect.facebook.net/en_US/all.js"></script>
<script>(function(d,s, id) {
  var js, fjs = d.getElementsByTagName(s)[0];
  if (d.getElementById(id)) return;
  js = d.createElement(s); js.id = id;
  js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
  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(){
$('#facebook_likebox').slideUp(1500);
}</script>
<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*/
outline:none;
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;
}

</style>

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>

<script type="text/javascript" src="http://www.dynamicdrive.com/dynamicindex9/fluidtextresizer.js">

/***********************************************
* Fluid Text Resizer- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* Visit http://www.dynamicDrive.com for hundreds of DHTML scripts
* This notice must stay intact for legal use
***********************************************/

</sc…

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="https://sites.google.com/site/bloggerhackingcom/home/download/social-traffic-pop.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"></script>
<script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script>
<script src="http://platform.twitter.com/widgets.js" type="text/javascript">
</script>
<script type="text/javascript" src="https://sites.google.com/site/bloggerhackingcom/home/download/jquery.stp.min.js">
</script>
<script>$(document).ready(function(){                      $().socialTrafficPop({timeout: 30,                    title: "Welcome To bestcareerbd.com ",
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="http://writebangla.sourceforge.net/HijriDate/index1.php"></script>

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

    <script type="text/javascript" src="http://writebangla.sourceforge.net/HijriDate/index4.php"></script>

This is for Showing English Date in Bangla:

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

Adding Translator for Site

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

<script language="JavaScript" src="http://freehostedscripts.net/fhstrans.php"></script>
<SCRIPT language=JavaScript type=text/JavaScript>translation_flags_g();</SCRIPT>

Adding Snow Effect in Website

Just pate this code to your site :
System1:  

<script type="text/javascript">

/******************************************
* Snow Effect Script- By Altan d.o.o. (http://www.altan.hr/snow/index.html)
* Visit Dynamic Drive DHTML code library (http://www.dynamicdrive.com/) 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="http://www.dynamicdrive.com/dynamicindex3/snow.gif"
  // 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>
<html>
<head>
<link rel="stylesheet"

href="http://www.dynamicdrive.com/dynamicindex17/dropincontentbox.css" />

<script type="text/javascript"

src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js"></script>
<script

src="http://www.dynamicdrive.com/dynamicindex17/jquery.easing.1.3.js"></script>
<script src="http://www.dynamicdrive.com/dynamicindex17/dropincontentbox.js">

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

</script>

<script>

var dropinbox1=new dropincontentbox({
source:['#dropbox',

'http://www.dynamicdrive.com/dynamicindex17/dropincontent.htm'], //#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">

#topbar{
position:absolute;
border: 1px solid black;
padding: 2px;
background-color: lightyellow;
width: 620px;
visibility: hidden;
z-index: 100;
}

</style>

<script type="text/javascript">

/***********************************************
* Floating Top Bar script- © Dynamic Drive (www.dynamicdrive.com)
* Sliding routine by Roy Whittle (http://www.javascript-fx.com/)
* This notice must stay intact for legal use.
* Visit http://www.dynamicdrive.com/ 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