Friday, 28 March 2014

Import/Export Widget Settings in WordPress


Sometimes when moving WordPress sites, you may need to save and reuse widget settings from one WordPress installation to another. If a site has just a few widgets, then you can probably do that manually. However, if there are many widgets inmultiple sidebars and widget areas, then you need a better solution. In this article, we will show you how to import/export widget settings in WordPress.
First thing you need to do is install and activate the Widget Settings Import/Exportplugin. Upon activation, go to Tools » Widget Settings Export and select the widgets you want to export and click on Export Widget Settings Button. The plugin will now export all your currently active widgets in widget_data.json file.

To restore these widgets in another WordPress installation, you will need to install and activate the Widget Settings Import/Export plugin on that site as well. Once you have activated the plugin, go to Tools » Widget Settings Import and click on the Select File button.
Locate the JSON file you downloaded earlier and then click on the Show Widgets Settings button. The plugin will now load widget data from the imported file and will show you the list of widgets. Select the widgets you want to import and click onImport Widget Settings to proceed. All your widgets will be restored to appropriate sidebars.
Please note that if you have active widgets added to your site by a plugin, then you may not be able to import those widgets until you have those plugins installed on the target website as well.
 

Monday, 24 March 2014

Bulk Install Your Favorite Plugins in WordPress

Every WordPress user has their favorite plugins which they like to use on all their sites. We have our own set of must use WordPress plugins. In the past, you had to manually install each individual plugin for every site that you setup. In this article, we will show you how to bulk install your favorite WordPress plugins. This will come in handy if you manage multiple WordPress sites and need to setup new WordPress sites regularly.
First thing you need to do is install and activate the WP Install Profiles plugin. After activation, you need to go to Plugins » Bulk Install Profiles.

You will see a default list of plugins there at first. If you want to use a plugin from that list, then keep the ones you want to use and delete the rest. You can also add new plugins to this list as long as they’re available on WordPress.org.
To add a plugin, you need to add the name used in the plugin’s URL slug. For example, if you want to add floating social bar, then you will enter either floating-social-bar or floating social bar.
Once you have entered all the plugins that you want to install, you can give this list a profile name, e.g. MyFavoritePlugins. After that you can save the profile, or click onDownload plugins and save profile.

Thursday, 20 March 2014

Paginate Comments in WordPress

Have you noticed that your post with lot of comments load slower than your other posts that has barely any comments. Because your most commented posts are usually the most popular, you want these posts to load fast. In this article, we will show you how to paginate comments in WordPress to speed up your post load time.
First thing you need to do is login to your WordPress admin area and go to Settings » Discussions. Next look at the section where it says Break comments into pages. Simply select the number of comments you want on each page, and how you want to display them.
http://shrikantitservices.blogspot.in/

Once you do this, based on your theme styling, either you will see a numeric pagination or you will see Previous / Next comment links.
Several users have reported that sometimes posts with a lot comments return awhite screen of death because it exhausts their memory.
If it doesn’t cause a white screen of death, then posts with a lot of comments tend to be really really slow. We strongly recommend that you paginate your comments.
Note: you can also paginate posts by splitting a long post into multiple pages.

Wednesday, 19 March 2014

Display a User’s IP Address in WordPress

Recently one of our users asked us if it was possible to detect and display individual visitors’ IP address in WordPress. Our answer was of course it is. In this article, we will show you how to display user’s IP address in WordPress.
You can use this to create your own IP detection site. This way when a website visitor views your site, they can see their own IP address.
All you have to do is paste the following snippet in your theme’s functions.php file
// Display User IP in WordPress

function wpb_show_ip()
{
        $user_ip = $_SERVER['REMOTE_ADDR'];
        return $user_ip;
}

add_shortcode('show_ip', 'wpb_show_ip');
 
Next thing you need to do is add the following shortcode in your post, page, or in a sidebar widget.
[show_ip]
If you’re using the shortcode in your sidebar text widget, and it is not working, then you need to make sure that you enable shortcode for sidebar widgets.
 

Thursday, 13 March 2014

What is jQuery filters ?

The jQuery filters enhance jQuery selectors by providing additional logic. And this actually sharpen the power of selectors.
Lets start with some basic filters for example :
  • The odd and even filters- find odd and even elements(zero-indexed)
  • Lets say a table with  5 rows
  • :gt & :lt They stands for greater than or less than.
  • :gt gives you children greater than index .
  • :lt gives you children lesser than index.
  •  Lets the table with 5 rows have elements(0,1,2,3,4).
  • ("tr:gt(3)") will gives rows 3 & 4.
  • ("tr:lt(3)") will gives rows 0 & 1.
Types of jQuery filter
Some of the main types are :
  • Basic filter
  • Child filter
  • Content filter
  • Visibility filter.
Uses of JQuery filter
Some of the key uses are given below :
  • It is very similar to selector in fact we can say that it is a type of selector to enhance the functionality of selector.
  • We can select filter according to their position.
  • We can select filter according to tag name.
  • We can select filter according to child, last-child ,nth child ,only child.
  • We can select filter according to their visibility.
  • We can select filter according to sibling, adjacent, or descendant etc.
Use of jQuery attribute filters
Using jQuery attribute filters make it easy to select and modify particular attributes in your html DOM.
Given below is the demonstration how you can apply filters on attribute ,here we are using "a href " attribute of html DOM :
  • Using it , you can hide all the link in your html page as : $("a[href]").toggle();.
  • But if you want to hide one link , you can do it as : $("a[href='http://www.ai.com/']").toggle();
  • If you want to hide the link which has "google" in href.
  • You can also hide the links which ends with "org" as  $("a[href$='org']").toggle();
  • You can also hide the link which starts like " http://doc " as : $("a[href^='http://docs']").toggle();

jQuery selectors


In this tutorial we are discussing jQuery selectors.
The jQuery selectors are one of the main feature in jQuery library .These selectors uses CSS syntax to allow page developer to easily identify the elements of page to operate upon with jQuery library methods. For using JQuery library most effectively , you must be familiar with  jQuery selectors.
Syntax pattern of jQuery selector :
$.(selector).methodName();
The selector is a string expression that identify the element on which the the method has to be implemented. For example :
$("p").click();
You can also hide the paragraph as follows :
$("p").hide();
You can also apply the CSS class to any element as :
$("p").addClass('box');
Types of jQuery selectors :
There are three categories of jQuery selector :
1.Basic CSS Selector
2.Positional Selector
3.Custom jQuery Selectors.

how to Find .htaccess File on Your WordPress Site

Recently, we advised a user to delete .htaccess file from their site to solve a common WordPress error. The user was unable to find their .htaccess file and thought that there was something wrong with his website. For beginners, things like this can be very confusing. In this article, we will show why you can’t find .htaccess file on your WordPress site, and how to create one when needed.
What is .htaccess file?

.htaccess file is a server configuration file which tells your server how to handle certain things on your website. Like how to redirect users, password protect admin area, or protect some directories, etc.
The dot before the file name indicates that it is a hidden file. When you are accessing your web server through FTP, you will not be able to see .htaccess file unless your FTP client is forced to show hidden files.

Why You Can’t Find .htaccess File?

The most common reason for this is that your WordPress site has not generated a .htaccess file yet. WordPress generates .htaccess file for the first time when you set up pretty permalinks on Settings » Permalinks screen. All you need to do is to click on Save Changes button on the permalinks screen and WordPress will generate a .htaccess file in your site’s root directory.