Thursday, July 30, 2015

Wordpress- set featured image in normal position

//set featured image in normal  position   
add_action('do_meta_boxes', 'featured_image_move_meta_box');
function featured_image_move_meta_box(){
    remove_meta_box( 'postimagediv', 'post', 'side' );
    add_meta_box('postimagediv', __('Carousel Image'), 'post_thumbnail_meta_box', 'post', 'normal', 'high');
}

Tuesday, July 28, 2015

Wordpress- My second plugin on wordpress community

Wordpress- My second plugin ''WP Custom Taxonomy Image' is now on wordpress community
Again a good news within month that my second wordpress plugin is appoved on wordpress community.
It is a plugin that allow you to add image with category/taxonomy.

Detail, you can see clicking WP Custom taxonomy Image 

Be free to post your comments /reviews , if you are getting any help or suggestion.

Thanks,

Saturday, July 25, 2015

Mysql- How can I access the MySQL command line with XAMPP for Windows?

Follow the following steps-
 
Step 1: Open command prompt 
 
Step 2: 
cd c:\xampp\mysql\bin
 
Step 3: 
mysql.exe -u root 
 
 

Friday, July 24, 2015

Javascript - Convert the local time to another time zone with this JavaScript

<html>
<head>
<script language="JavaScript">

// function to calculate local time
// in a different city
// given the city's UTC offset
function calcTime(city, offset) {

    // create Date object for current location
    d = new Date();

    // convert to msec
    // add local time zone offset
    // get UTC time in msec
    utc = d.getTime() + (d.getTimezoneOffset() * 60000);

    // create new Date object for different city
    // using supplied offset
    nd = new Date(utc + (3600000*offset));

    // return time as a string
    return "The local time in " + city + " is " + nd.toLocaleString();

}

// get Bombay time
alert(calcTime('Bombay', '+5.5'));

// get Singapore time
alert(calcTime('Singapore', '+8'));

// get London time
alert(calcTime('London', '+1'));

</script>
</head>
<body>

</body>
</html>

Monday, July 13, 2015

Magento - set cron using cpanel

  1. Go to cpanel login
  2. Look for Cron section
  3. If you know the path of the cron file in the filemanager, enter the command like below. You can set cron for minutes, hourly, daily, monthly or for weekdays.
  4.  
  5.  If you don’t know the file path then use this command and configuration. As said you can schedule the cron as you want, I have configured here to run the cron every 5 minutes. 

Sunday, July 12, 2015

Magento - set cron using cpanel

Magento - set cron using cpanel

wget http://www.your-site.com/cron.php >/dev/null 2>&1

In cron.php add after line 47
$isShellDisabled = true;

Wordpress- My first plugin on wordpress community

Wordpress- My first plugin ''WP Custom Texonomy Meta' is now on wordpress community
Toady, I am very happy because my first wordpress plugin is appoved on wordpress community.
It is plugin to add custom meta fields within built in and custom taxonomies. Simply add the desired fields by going through WP-admin -> Settings ->Taxonomy Meta .

Detail, you can see clicking WP Custom taxonomy meta 

Be free to post your comments /reviews , if you are getting any help or suggestion.

Thanks,

Wednesday, July 8, 2015

jQuery- All child checkbox checked on checked in jquery


<script src="http://code.jquery.com/jquery-latest.min.js" type="text/javascript"></script>
<script>
var nocon = jQuery.noConflict();
nocon(document).ready(function(){

  nocon(".chk").click(function(ev) {

    nocon(this).siblings('ul').find("input[type='checkbox']").prop('checked', this.checked);
        ev.stopImmediatePropagation();
  });
});
</script>

<ul><li><input type="checkbox" class="chk"><a href="">1</a>
   <ul>
   <li>
   <input type="checkbox"class="chk"><a href="">2_1</a>
                       <ul>
                       <li><input type="checkbox" class="chk"><a href="">3_1</a></li>
                       <li><input type="checkbox" class="chk"><a href="">3_2</a></li>
                       </ul>
                   
                      </li>
                    <li>
                      <input type="checkbox"class="chk"><a href="">2_2</a>
                       <ul>
                       <li><input type="checkbox" class="chk"><a href="">3_3</a></li>
                       <li><input type="checkbox" class="chk"><a href="">3_4</a></li>
                       </ul>
                   
                      </li>
                      </ul>
                      </li>
        <li><input type="checkbox" class="chk"><a href="">1</a>
   <ul>
   <li>
   <input type="checkbox"class="chk"><a href="">2_1</a>
                       <ul>
                       <li><input type="checkbox" class="chk"><a href="">3_1</a></li>
                       <li><input type="checkbox" class="chk"><a href="">3_2</a></li>
                       </ul>
                   
                      </li>
                    <li>
                      <input type="checkbox"class="chk"><a href="">2_2</a>
                       <ul>
                       <li><input type="checkbox" class="chk"><a href="">3_3</a></li>
                       <li><input type="checkbox" class="chk"><a href="">3_4</a></li>
                       </ul>
                   
                      </li>
                      </ul>
                      </li>           
                   
                      </ul>