Hello Friends!

Hope you all doing well :)

I have launched my another new  “WP Social Buttons” wordpress plugin.

“WP Social Buttons”
is the very simple plugin for add to floating social buttons on your site.

Screenshot-3

“wp-social-buttons” is the very simple plugin for add to social buttons on your site(floating sidebar). Using this plugin you can easly share your website with your firends on Facebook,Twitter,Linkedin,Pinterest,Google+. There are not added any external JS files in this plugin so it’s does not effect on your site speed as well.

Features

  • Floating Sidebar
  • Options to show/hide the specific social buttons
  • Options for define the postion(Left/Right) of floating sidebar

 

Download This Plugin

Hope you all will be enjoy my this plugin! :)

Enjoy My Plugin

Hello friends!

Hope you all are doing well!

Last time i was launched my “Custom Share Buttons” wordpress plugin http://raghunathgurjar.wordpress.com/2014/07/17/launched-custom-share-buttons-version-1-1/ version 1.1

Now i have launched new version 1.3, So go here http://wordpress.org/plugins/custom-share-buttons-with-floating-sidebar/ for download the new version

Change Log 1.2 & 1.3

  • Added an options for add the social share buttons on bottom of the content on every post/pages
  • Fixed button image gap issue for right position
  • Added new option for set the delay time to publish the share butttons

Screenshot-1

Please do not forget to leave your feedback about my plugin on wordpress site!

Enjoy! :)

Hello Friends!

Hope you all are doing well.

If you want to disable the theme and plugin file editor from admin then don’t worry, i am here only for you :)

add the give code below  in wp-config file.

Basically this is very important for make your site more secure because generally most of people have used their UN-secure admin password , they have used password like “admin123″, “admin”,”admin@123″ and site hacker can easily your hack your admin password.

After hack the admin access he can changes anything in theme files  as well plugin files also and after done anything by hacker in files your site will be down. So don’t waste your time just add this code in your wp-config.php files

define( 'DISALLOW_FILE_EDIT', true );

Enjoy Code!

Hello Friends!

Hope you are doing well :)

I am here going to tell you some useful script for manage .htaccess file of your website.

  1. First of all you have need to check the  RewriteEngine is “on” or not in your htaccess file. if not then add the given code in top of the file
    RewriteEngine on
  2. How redirect site form NON-WWW to WWW url using htaccess?
    ##non-www to www
    RewriteCond %{HTTP_HOST} !^www\.
    RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
  3. How redirect site from WWW to NON-WWW url using htaccess?
    pre>## www to non-www
    RewriteCond %{HTTP_HOST} ^www\. [NC]
    RewriteRule ^(.*)$ %{HTTP_HOST}$1 [C]
    RewriteRule ^www\.(.*)$ http://$1 [L,R=301]
  4. How create a single line code for read “.php” files as “.html using htaccess”?
    ## Add rewrite rule for call ".php" pages as ".html" pages
    # Example about-us.php file will be read as about-us.html
    Options +Indexes
    Options +FollowSymlinks
    RewriteRule ^([^.]+)\.html$ $1.php [L]
  5. How remove the index.php OR index.html from the site url using htaccess
    RewriteRule ^(.*)index\.(htm|html|php)$ http://%{HTTP_HOST}/$1 [R=301,L]
  6. How redirect Old Site to new New Site?
      RewriteCond %{HTTP_HOST} ^olddomain.com$ [OR]
      RewriteCond %{HTTP_HOST} ^www.olddomain.com$
      RewriteRule (.*)$ http://www.newdomain.com/$1 [R=301,L]

Enjoy Code!

Hello Friends!

Hope you all are doing well :)

In my last post i have explain to you  all my friends a way for  “add a new “Custom Fields” on taxonomy/category page

http://raghunathgurjar.wordpress.com/2014/04/14/how-add-new-custom-fields-on-taxonomycategory-page-using-hooks-wordpress/

Now i am going to explain you for show the newly added custom field and its value on “Category List” page

custom-filed

For do that you have need only to use my code and follow steps give below:

Steps.1 – First of all you have need to add given code in your theme function file

//For add the new fields 
function my_column_header($columns)
{
    $columns['customval'] = __('Custom Field');
    return $columns;
}
add_filter('manage_edit-category_columns', 'my_column_header', 10, 2);

After add this code in your theme function file you will be see the custom fields title

title

Step.2 – Now you have need to add the given code in your theme function for get the custom field value

//Get the custom field value
function my_column_value($empty = '', $custom_column, $term_id)
{
    //Category custom field
   $term_meta = get_option( "taxonomy_term_$term_id" ); 
   $CustomValue=$term_meta['wpsc_product_category_catsortby'] ? $term_meta['category_customval'] : '0';
       
 return $CustomValue;
}
add_filter('manage_category_custom_column', 'my_column_value', 10, 3);

 

That’s All :)

Enjoy Code! | Raghunath Blog

 

Hello Friends!

Facebook has done some changes in his API so that’s why we are unable to define the “Share Image” in facebook share window in a way that was given on my last post http://raghunathgurjar.wordpress.com/2013/08/21/how-add-thumb-image-in-custom-facebook-share-link-window/ but don’t worry i am here only for you :)

Using “OG Meta Tags” we can define facebook share window content, for more details about “OG Meta Tags” you can visit facebook official page https://developers.facebook.com/docs/plugins/checklist/

you have need to add the og meta tags in head section (between <head></head> tags) in given format :

<meta property="og:title" content="Your Title">

<meta property="og:image" content="Your image path">

<meta property="og:description" content="Your description">

After add the OG meta tag , you have need to add your share url (url that you want share) like this https://www.facebook.com/sharer/sharer.php?u=your-site-url

For Example :Share My Blog

That’s All :)
Enjoy Code! | Raghunath Blog

Hello Friends!

In admin if you want to add a new “Custom Fields” on taxonomy/category page without any changes in wordpress core files then don’t worry :) , you can add your new custom field using hooks.

Screenshot

Just add given code in your theme function file.

// A callback function to add a custom field to our "custom" taxonomy  
function custom_taxonomy_custom_fields($tag) {  
   // Check for existing taxonomy meta for the term you're editing  
    $t_id = $tag->term_id; // Get the ID of the term you're editing  
    $term_meta = get_option( "taxonomy_term_$t_id" ); // Do the check  


echo '<tr class="form-field">  
    <th scope="row" valign="top">  
        <label for="custom_id"><?php _e('Custom Field');?></label>  
    </th>  
    <td>  
        <input type="text" name="term_meta[custom_catsortby]" id="term_meta[custom_catsortby]" size="25" style="width:60%;" value="<?php echo $term_meta['custom_catsortby'] ? $term_meta['custom_catsortby'] : '';?>"><br />  
        <span class="description"><?php _e('The new Custom Field'); ?></span>  
    </td>  
</tr>';   
}
// Add the fields to the "custom" taxonomy, using our callback function  
add_action( 'custom_edit_form_fields', 'custom_taxonomy_custom_fields', 10, 2 );  

/*  Save the custom field value into database */

// A callback function to save our extra taxonomy field(s)  
function save_taxonomy_custom_fields( $term_id ) {  
    if ( isset( $_POST['term_meta'] ) ) {  
        $t_id = $term_id;  
        $term_meta = get_option( "taxonomy_term_$t_id" );  
        $cat_keys = array_keys( $_POST['term_meta'] );  
            foreach ( $cat_keys as $key ){  
            if ( isset( $_POST['term_meta'][$key] ) ){  
                $term_meta[$key] = $_POST['term_meta'][$key];  
            }  
        }  
        //save the option array  
        update_option( "taxonomy_term_$t_id", $term_meta );  
    }  
}  
// Save the changes made on the "custom" taxonomy, using our callback function  
add_action( 'edited_custom', 'save_taxonomy_custom_fields', 10, 2 );  

//For retrieve the value in front-end
$newterm_id='put here term id';
$term_meta = get_option( "taxonomy_term_$newterm_id" ); // Do the check  
echo "<b>Custom Field Value:</b> ".$term_meta['custom_catsortby'];

That’s All :)

Enjoy Code! || Raghunath Blog

Hello Friends!

Hope you are doing well :)

If you want to edit the html of default search form in your wordpress website, then don’t warry :) just add my code in your theme function file.

raghu-blog

/********************************************
 * Start search form hookes part here
*********************************************/
function my_search_form( $form ) {
    $form = '<form role="search" method="get" id="searchform" class="searchform" action="' . home_url( '/' ) . '" >
    <div>
    <input type="text" value="' . get_search_query() . '" name="s" onblur="if (this.value == \'\') {this.value = \'Search\';}" onfocus="if (this.value == \'Search\') {this.value = \'\';}" id="setop"/>
    <input type="submit" id="searchsubmit" value="'. esc_attr__( 'Search' ) .'" />
    </div>
    </form>';

    return $form;
}

add_filter( 'get_search_form', 'my_search_form' );
/********************************************
 * End hookes part here
*********************************************/

Enjoy Code! | Raghunath Blog