how to add google search to wordpress manually

wordpress has inbuilt search, still people want to add the advanced search in their site. we will show, how to add google search to wordpress manually.

how to add google search to wordpress manually

There are too many sites build on wordpress. wordpress gives inbuild search option in cms. But still people want to add the advanced search in there site. I suggest you can add the google search in wordpress site. Adding google search in wordpress site is really SEO friendly also. It is very easy to add the google search system in wordpress sites.

In some very simple steps you can add the google search in wordpress sites.

First login to google and go to following URL:
https://www.google.com/cse/

how to add google search to wordpress manually
how to add google search to wordpress manually

Just add the your site and and get your site custom google search for your site.

Before this you need to create the wordpress page for showing the search result page.

I created page called “search result”. For getting JS code you need give search result page path in google settings.

You will get options for selecting search result layout. Here you will get two javascripts code for google search form and search result.

After getting the two javscript code. You need to add the form code into wordpress widget.

On search result page just add the second code and save it. That sit. Your custom site google search is ready.

You can Customize Google Custom Search Engine Colors and Looks as your site color and theme.

wordpress gogogle search -CSE - Look and Feel
wordpress gogogle search -CSE – Look and Feel

Sample Form Code: (you can use following code in wordpress widget)

<form action="https://purabtech.in/search-result/" id="cse-search-box">
<div>
815y3hyfmru" />
<input type="hidden" name="cof" value="FORID:10" />
<input type="hidden" name="ie" value="ISO-8859-1" />
<input type="text" name="q" size="32" />
<input type="submit" name="sa" value="Search" />
</div>
</form>

Following code you can use in search result page

cse-search-results">

var googleSearchIframeName = "cse-search-results";
var googleSearchFormName = "cse-search-box";
var googleSearchFrameWidth = 550;
var googleSearchDomain = "www.google.com";
var googleSearchPath = "/cse";
// ]]></script>

Google Search Trick in wordpress. There is width issue in search result page. Google search result render with 768px width.
You need to just add following CSS code in your wordpress theme style.css file.

#cse-search-results iframe {width: 200px; }

custom google site search you can add in any wordpress site without any wordpress plugin.

most used wordpress functions in theme

In wordpress theming is very important. Developers know the importance of functions.php file. Here we given most used wordpress functions in theme which will be useful for wordpress developer. I always written some very nice code snippets in functions.php file.

most used wordpress functions in theme

I found very useful codes which is very helpful for very wordpress designer and developers.

Here is very useful code snippets.
Enable Hidden Admin Feature displaying ALL Site Settings

// CUSTOM ADMIN MENU LINK FOR ALL SETTINGS
   function all_settings_link() {
    add_options_page(__('All Settings'), __('All Settings'), 'administrator', 'options.php');
   }
   add_action('admin_menu', 'all_settings_link');

Remove Update Notification for all users except ADMIN User

// REMOVE THE WORDPRESS UPDATE NOTIFICATION FOR ALL USERS EXCEPT SYSADMIN
       global $user_login;
       get_currentuserinfo();
       if (!current_user_can('update_plugins')) { // checks to see if current user can update plugins
        add_action( 'init', create_function( '$a', "remove_action( 'init', 'wp_version_check' );" ), 2 );
        add_filter( 'pre_option_update_core', create_function( '$a', "return null;" ) );
       }

Include custom post types in the search results.

// MAKE CUSTOM POST TYPES SEARCHABLE
function searchAll( $query ) {
 if ( $query->is_search ) { $query->set( 'post_type', array( 'site','plugin', 'theme','person' )); }
 return $query;
}
add_filter( 'the_search_query', 'searchAll' );

Add your custom post types to your sites main RSS feed by default.

// ADD CUSTOM POST TYPES TO THE DEFAULT RSS FEED
function custom_feed_request( $vars ) {
 if (isset($vars['feed']) && !isset($vars['post_type']))
  $vars['post_type'] = array( 'post', 'site', 'plugin', 'theme', 'person' );
 return $vars;
}
add_filter( 'request', 'custom_feed_request' );

Modify the Login Logo & Image URL Link

add_filter( 'login_headerurl', 'namespace_login_headerurl' );
/**
 * Replaces the login header logo URL
 *
 * @param $url
 */
function namespace_login_headerurl( $url ) {
    $url = home_url( '/' );
    return $url;
}

add_filter( 'login_headertitle', 'namespace_login_headertitle' );
/**
 * Replaces the login header logo title
 *
 * @param $title
 */
function namespace_login_headertitle( $title ) {
    $title = get_bloginfo( 'name' );
    return $title;
}

add_action( 'login_head', 'namespace_login_style' );
/**
 * Replaces the login header logo
 */
function namespace_login_style() {
    echo '<style>.login h1 a { background-image: url( ' . get_template_directory_uri() . '/images/logo.png ) !important; }</style>';
}

Loading jQuery from the Google CDN

// even more smart jquery inclusion :)
add_action( 'init', 'jquery_register' );

// register from google and for footer
function jquery_register() {

if ( !is_admin() ) {

    wp_deregister_script( 'jquery' );
    wp_register_script( 'jquery', ( 'https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js' ), false, null, true );
    wp_enqueue_script( 'jquery' );
}
}

Remove the WordPress Version Info for Security

// remove version info from head and feeds
function complete_version_removal() {
    return '';
}
add_filter('the_generator', 'complete_version_removal');

Add Spam & Delete Links to Comments on Front End

// spam & delete links for all versions of wordpress
function delete_comment_link($id) {
    if (current_user_can('edit_post')) {
        echo '| <a href="'.get_bloginfo('wpurl').'/wp-admin/comment.php?action=cdc&c='.$id.'">del</a> ';
        echo '| <a href="'.get_bloginfo('wpurl').'/wp-admin/comment.php?action=cdc&dt=spam&c='.$id.'">spam</a>';
    }
}

Remove Default WordPress Meta Boxes

// REMOVE META BOXES FROM DEFAULT POSTS SCREEN
   function remove_default_post_screen_metaboxes() {
 remove_meta_box( 'postcustom','post','normal' ); // Custom Fields Metabox
 remove_meta_box( 'postexcerpt','post','normal' ); // Excerpt Metabox
 remove_meta_box( 'commentstatusdiv','post','normal' ); // Comments Metabox
 remove_meta_box( 'trackbacksdiv','post','normal' ); // Talkback Metabox
 remove_meta_box( 'slugdiv','post','normal' ); // Slug Metabox
 remove_meta_box( 'authordiv','post','normal' ); // Author Metabox
 }
   add_action('admin_menu','remove_default_post_screen_metaboxes');

// REMOVE META BOXES FROM DEFAULT PAGES SCREEN
   function remove_default_page_screen_metaboxes() {
 remove_meta_box( 'postcustom','page','normal' ); // Custom Fields Metabox
 remove_meta_box( 'postexcerpt','page','normal' ); // Excerpt Metabox
 remove_meta_box( 'commentstatusdiv','page','normal' ); // Comments Metabox
 remove_meta_box( 'trackbacksdiv','page','normal' ); // Talkback Metabox
 remove_meta_box( 'slugdiv','page','normal' ); // Slug Metabox
 remove_meta_box( 'authordiv','page','normal' ); // Author Metabox
 }
   add_action('admin_menu','remove_default_page_screen_metaboxes');

Add Custom User Profile Fields

// CUSTOM USER PROFILE FIELDS
   function my_custom_userfields( $contactmethods ) {

    // ADD CONTACT CUSTOM FIELDS
    $contactmethods['contact_phone_office']     = 'Office Phone';
    $contactmethods['contact_phone_mobile']     = 'Mobile Phone';
    $contactmethods['contact_office_fax']       = 'Office Fax';

    // ADD ADDRESS CUSTOM FIELDS
    $contactmethods['address_line_1']       = 'Address Line 1';
    $contactmethods['address_line_2']       = 'Address Line 2 (optional)';
    $contactmethods['address_city']         = 'City';
    $contactmethods['address_state']        = 'State';
    $contactmethods['address_zipcode']      = 'Zipcode';
    return $contactmethods;
   }
   add_filter('user_contactmethods','my_custom_userfields',10,1);

Add an excerpt box for pages

if ( function_exists('add_post_type_support') )
{
    add_action('init', 'add_page_excerpts');
    function add_page_excerpts()
    {
        add_post_type_support( 'page', 'excerpt' );
    }
}

Function to change the length of Exerpt

function new_excerpt_length($length) {
    return 100;
}

add_filter('excerpt_length', 'new_excerpt_length');

Auto Extract the First Image from the Post Content

/ AUTOMATICALLY EXTRACT THE FIRST IMAGE FROM THE POST
function getImage($num) {
    global $more;
    $more = 1;
    $link = get_permalink();
    $content = get_the_content();
    $count = substr_count($content, '<img');
    $start = 0;
    for($i=1;$i<=$count;$i++) {
        $imgBeg = strpos($content, '<img', $start);
        $post = substr($content, $imgBeg);
        $imgEnd = strpos($post, '>');
        $postOutput = substr($post, 0, $imgEnd+1);
        $postOutput = preg_replace('/width="([0-9]*)" height="([0-9]*)"/', '',$postOutput);;
        $image[$i] = $postOutput;
        $start=$imgEnd+1;
    }
    if(stristr($image[$num],'<img')) { echo '<a href="'.$link.'">'.$image[$num]."</a>"; }
    $more = 0;
}

Unregister WP Default Widgets

// unregister all default WP Widgets
function unregister_default_wp_widgets() {
    unregister_widget('WP_Widget_Pages');
    unregister_widget('WP_Widget_Calendar');
    unregister_widget('WP_Widget_Archives');
    unregister_widget('WP_Widget_Links');
    unregister_widget('WP_Widget_Meta');
    unregister_widget('WP_Widget_Search');
    unregister_widget('WP_Widget_Text');
    unregister_widget('WP_Widget_Categories');
    unregister_widget('WP_Widget_Recent_Posts');
    unregister_widget('WP_Widget_Recent_Comments');
    unregister_widget('WP_Widget_RSS');
    unregister_widget('WP_Widget_Tag_Cloud');
}
add_action('widgets_init', 'unregister_default_wp_widgets', 1);

Enable GZIP output compression

if(extension_loaded("zlib") && (ini_get("output_handler") != "ob_gzhandler"))
   add_action('wp', create_function('', '@ob_end_clean();@ini_set("zlib.output_compression", 1);'));

Enable shortcodes in widgets

// shortcode in widgets
if ( !is_admin() ){
    add_filter('widget_text', 'do_shortcode', 11);
}

If you have any interesting code snippets then please suggest me.

most used wordpress functions in theme
most used wordpress functions in theme

add google plus button to wordpress without plugin

Many people asking me how to add the google plugin button in wordpress without plugin. WordPress tutorial for, add google plus button to wordpress without plugin. You can easily add the google plus button counter to your wordpress website.

add google plus button to wordpress without plugin

I added the google button code to digcms.com site.

You just need to add the following code to site.


&lt;!-- Place this tag where you want the +1 button to render --&gt;
&lt;g:plusone size=&quot;tall&quot;&gt;&lt;/g:plusone&gt;

&lt;!-- Place this render call where appropriate --&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
 (function() {
 var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
 po.src = 'https://apis.google.com/js/plusone.js';
 var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
 })();
&lt;/script&gt;

For getting the different style of google plus button you can go to following site.

http://www.google.com/webmasters/+1/button/

add google plus button to wordpress without plugin
add google plus button to wordpress without plugin

Create an Autocomplete Search Field in wordpress

WordPress tutorial for, Create an Autocomplete Search Field in wordpress. In wordpress also you can easily achieve the auto complete search form easily.

Create an Autocomplete Search Field in wordpress

Now auto complete search box is very common for every web projects. Auto complete search functionality you can see in google also. In wordpress also you can easily achieve the auto complete search form easily.

Create an Ajax-based Auto complete Search Field in wordpress
Create an Ajax-based Auto complete Search Field in wordpress

There is very nice Jquery plugin for auto complete. First download the latest version of jQuery , as well as the autocomplete plugin. Now, create a folder in your theme called “javascripts” and copy paste the two files in that folder. Open your header.php from your wordpress theme folder and put following code in that file.

<script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/javascripts/jquery.js"></script>
<script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/javascripts/jquery.autocomplete.pack.js"></script>
<link rel="stylesheet" type="text/css" href="<?php bloginfo('template_directory'); ?>/javascripts/jquery.autocomplete.css" media="screen" />
<script type="text/javascript">
$(document).ready(function(){
    var data = '<?php global $wpdb; $search_tags = $wpdb->get_results("SELECT name FROM $wpdb->terms"); foreach ($search_tags as $mytag){ echo $mytag->name. " "; } ?>'.split(" ");
    $("#SEARCH_INPUT_BOX").autocomplete(data);
})
</script>

Just you need change the search input box id in place of SEARCH_INPUT_BOX.
If you are wordpress developer then only use the above code in header.php file. If you are facing any issue then please write to on support@purabtech.in.

Here are some very useful articles which are related to wordpress Search functionality.

Add a search from in your navigation menu of wordpress theme

Set the style for default search widget

some minimal, fast loading and small free wordpress themes

Here we have List of some minimal, fast loading and small free wordpress themes. Fast loading wordpress theme is good for seo. Try to use minimal theme, It will load faster and your visitor bounce rate will reduce. If you excepting high traffic to website than this wordpress theme list will be useful to you.

More Informative Links about wordpress themes

some minimal, fast loading and small free wordpress themes
Best of pinterest style free wordpress themes
Top 10 WordPress Themes ruling contemporary eCommerce Platform
100+ creative free portfolio wordPress themes
Unique Retro WordPress Themes – Free collection
100+ creative free portfolio wordPress themes
101+ Free wordpress responsive themes
Best 10 free wordpress insurance themes
Free magazine style wordpress themes
best free wordpress themes for personal bloggers
free 40+ professional three column wordpress themes
WordPress themes for Beer Bars and Drinks
Free WordPress themes for Yoga and Skin and Health
10 best free premium wordpress themes collection

 some minimal, fast loading and small free wordpress themes

Some time due host hosting or server capabilities you need use the minimal themes. Using fast loading wordpress themes always good for seo also. Google checks how fast your site is loading. If your wordpress site is taking too much time to loading than user will go away from your site. So many web bloggers use the minimal and fast loading free wordpress themes.

Here I created a list of some very fast loading and small free wordpres themes.

Work-a-holic

some minimal, fast loading and small free wordpress themes
some minimal, fast loading and small free wordpress themes

AfterBurner

some minimal, fast loading and small free wordpress themes
some minimal, fast loading and small free wordpress themes

Swift

some minimal, fast loading and small free wordpress themes

CopyBlogger

some minimal, fast loading and small free wordpress themes

WP-Simpy

Manifest

Modern Clix

Undedicated

Cardeo Minimal

Clean Home

The Journalist

Magatheme

Kallista

Minimal Gray

Pixelate

Ambiru

Emire

Simpla

Elite

Tarski

Agneka Simple

Textback

This list is created by wordperssapi.com. If you are having any suggestions about any minimal theme then please write to us on support@purabtech.in or put comment.

checklist for self hosted wordpress sites

When you creating site in wordpress, I created unique checklist for self hosted wordpress sites. checklist for self hosted wordpress sites is very important.

checklist for self hosted wordpress sites

When you creating the website in wordpress that time you need to be very careful and you need think and check about following things. I created the checklist for wordpress sites.

About Theme

Use the Minimum images

checklist for self hosted wordpress sites
checklist for self hosted wordpress sites

You should use the sprite image in wordpress theme. That will reduce the webpage loading time.

Use proper and optimized CSS properties

You should use the proper CSS. Dont repeat CSS code. like float, color, margin.

Test the Theme in IE7, IE8 ,Firefox, Safari and Google Chrome

Your theme need to be cross browser compatible.

Use only External CSS

Dont use the inline CSS in Theme.

Use Jquery

Jquery is very popular and simple and seo friendly for wordpress site.

Use the Sidebars in your theme

In sidebar you mostly put the links and ads. That is very important for SEO.

Put the Tag and category links

You should put the tags and category links in theme.

Make Mobile friendly

You theme should viewable in iPhone, iPad, Blackberry mobile devices.

Check in WordPress site

  • Check Robots.txt file
  • Put Site title
  • Get some good Tagline for the site
  • Create contact us email address
  • Put Share links ie. Twitter, Facebook, MySpace, RSS, LinkedIn etc.
  • Create Author’s profile: Email, Website, AIM, Biographical Info
  • Put the Google Analytics code in your site
  • Do web master varification
  • Use the SEO Meta Tags (Use the SEO Meta Tags plugin)
  • Submit your site to to Yahoo, Google, Bing
  • Use good wordpress plugins
  • Use the Permalinks (date and name. if do not want to show category in url then use ‘No Category Base’ plugin)
  • All Posts and Pages with genuine and useful articles
  • Create nice Categories and their structure (parent-child)
  • Remove broken urls (if urls not provided use ‘javascript:;’ in anchor’s href)
  • Use the Widgets and Menus with their urls
  • Put Akismet API key -For Spam protection.
  • Do setting for Media sizes (thumbnail, medium, large)
  • Uncheck the “Organize my uploads into month- and year-based folders” setting in media setting.
  • Use the SEO ultimate plugin.
  • Dont use the plugin for contact form

Here are some useful links which will be helpful to you

Best WordPress SEO Plugins for Optimize your WordPress Website

best android applications for business

In this article I will give your some great business apps for Android? we’ve selected some of the best and most useful apps for your Android smart-phone.

Best Android Applications for Business

All the application are available at the Android Market.

Yelp

Though Yelp brings its sleek red design to its Android app, it leaves out some functionality.

Evernote

According to the video on its Website, Evernote “grabs your info from anywhere and takes it to the magic cloud of elephants,” a wondrous place where pink elephants process your data, index it, and make it searchable for easy retrieval. Elephants aside, Evernote is a comprehensive, cross-platform note-taking application that integrates hardware, software, and other third-party apps. The free app captures text notes, voice notes, photos, or files and stores them in the cloud for easy retrieval.

Wikipedia & more!

If you have an Android phone and need a Wikipedia browsing app, then try Wapedia by Taptu. Wapedia may be the only Wiki app you’ll need.

Meebo IM

Best chat application.

Google Voice

How many google ads we can show web page

Many times we thought If we put multiple ad units on single web then we can generate more revenue from google Ads. But that is not true because If we put multiple Ad units on single webpage then google never serve Ads for all Ad unit.

 

How many google ads we can show web page

 

How many google ads we can show web page
How many google ads we can show web page

There is limitation from google side. Publishers can only place the three AdSense for content units on one webpage. You may also place a maximum of three link units and two search boxes on each webpage. Means you can put the three link ads and three content ads and two search box on single web page.

If you place more than three ad unit on a single webpage,  google will display unique ads to each ad unit. Because google system automatically displays an optimal number of highly targeted Google ads on each page.

6 free seo tools from google

6 free seo tools from google, SEO is very important when you are building and maintaining a website, and Google offers FREE tools to help make your job easier.

 

6 free seo tools from google

 

6 free seo tools from google
6 free seo tools from google

Google provides very nice free SEO tools here is list.

Google Analytics:

According to the website, Google Analytics gives you rich insights into your website traffic and marketing effectiveness. User friendly features allow you to see and analyze your traffic data in a whole new way, as well as produce better targeted ads, create higher converting websites and strengthen your marketing initiatives.

Google Trends:

With Google Trends, you can compare the whole world’s interest in the topic of your choice. You can enter up to 5 topics to see how often they have been searched, how often they show up in Google News stories and what geographic locations have searched these topics the most.

Google Keyword Tool:

Undoubtedly one of the most popular in the Google toolbox, the Keyword Tool can be a gigantic help in choosing the right and most effective keywords!

Google Website Optimizer:

A very easy to use free tool for testing your website content to see if it is delivering actionable results. You can find out what leads to the highest conversion rates, listen to your visitors and increase conversions dramatically. A great free tool!

Google Webmaster Tools:

This one gives you detailed reports about your web pages’ visibility in Google search. You can see at a glance how Google crawls and indexes your site, as well as find out about problems Google is having with your site and how to fix them. You can also use the free link reporting tools and query traffic to see which search queries are driving traffic to your site.

Google Traffic Estimator:

This one will come in quite handy as it tells you such important things as average estimated CPC, estimated ad position, estimated daily cost and estimated daily clicks.

Using above tools you can boost your website.

Google Voice is out in U.S.


Google Voice is now available for everyone (provided you have a U.S. phone number).

The service, which started life out as GrandCentral, acts as a unified phone number. It can be used to make free calls to the U.S. and Canada, to send free text messages and more. Its voicemail system can even be.

Now, after more than fifteen months of testing with invite-only accounts, Google Voice is ready for the masses.

As great as the service is, it hasn’t existed without controversy. Last summer, Apple was criticized when the company barred the Google Voice iPhone app from its App Store. The battle over Google Voice was arguably the first shot in the current Apple-Google war.

And earlier today, Business Week reported that Frontier Communications is suing Google over alleged patent violations within the Google Voice service.

For many users however, Google Voice is a wonderful solution to the increasingly complex web of communication profiles. Instead of having to try to maintain separate phone numbers, users can just have one central number forwarded to different devices based on time of day or location.