Showing posts with label WordPress. Show all posts
Showing posts with label WordPress. Show all posts

Wednesday 2 October 2013

Prevent Image Hotlinking With .htaccess

Image courtesy of markinns.com
Ever wonder how someone stealing your images, directly taking the URL and display on their own website can effect your bandwidths? This is what we call image hotlinking. With every single view of our images on their site cost us bandwidths. Because it's called directly from our server.

Not sure about you, but I paid for this bandwidths (not for this site). Just like almost everything, there is a way to stop thieves  from stealing our bandwidths without our permission. For those who are wondering, this tutorial is also for WordPressers.

Visit your FTP/File Manager and add following to your .htaccess file:

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?yourdomain.com [NC]
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?yourdomain2.com [NC]
RewriteRule \.(jpg|jpeg|png|gif)$ https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjentSbUVx-fuFCCSHSi_6OL0g8IjaYt5K94H5s5v8jCEd4THGRVviaGxcMc5LOVsmvIpC0AuKe1NK4yNMW6lax31b3K6hhQZM2TBblWoGtSQ_i9jK-e4SvIAw0NuU3Vo5KkO0y2n0rPZ4/s1600/Hotlinking.gif [NC,R,L]

By default all sites are blocked from hotlinking. Only those specified by you are allowed to do so. Don't forget to replace yourdomain.com in above code with your website's URL. You can add as many URLs as you want.

Also the link https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjentSbUVx-fuFCCSHSi_6OL0g8IjaYt5K94H5s5v8jCEd4THGRVviaGxcMc5LOVsmvIpC0AuKe1NK4yNMW6lax31b3K6hhQZM2TBblWoGtSQ_i9jK-e4SvIAw0NuU3Vo5KkO0y2n0rPZ4/s1600/Hotlinking.gif is to a image you’ve set, and whenever image hotlinking is detected, this image will show up. You can change it to your favorite hotlinking message or anything you want. Just make sure where this image is not hotlink protected.

Tuesday 1 October 2013

Hide Dashboard Login Errors In WordPress

In this tutorial, I'm going to show how you can easily hide login errors in WordPress. It's a great way to protect from WordPress from hackers. Whenever you login with the correct username but with the wrong password, a message appears saying "Error: Incorrect Password." WordPress has now given a clue to hacker that the username entered is in the system, and that they simply need to crack its password.

Similarly, an "Error: Invalid username" also appears when you enter an unavailable username. It's better for you to prevent hacking by hiding this error message. In order to keep this from happening, you need to add this code to your functions.php file:

add_filter('login_errors', create_function('$a', "return null;"));

This filter code will remove error message from the login page. The error box will still appear, but without any text.

How To Automatically Empty Trash In WordPress

The Trash feature was introduced in WordPress 2.7, and since then, if you click "Trash" for any item, it will be sent to the trash. It works similar to the Recycling Bin feature on Windows. By default, the content you trash remains there for 30 days before being permanently deleted. However, you can also delete items from the Trash at any time.

You can also modify the 30 day period with some simple codes. Just add this line to wp-config.php and you’re done:

define('EMPTY_TRASH_DAYS', 5 ); // Empty trash every 5 days

Monday 30 September 2013

How To Create A Custom Dashboard Widgets In WordPress


Earlier this hour I was surfing thru WordPress' official codex website and I found something very interesting to write about. Okay! I know you guys are so exited about this great trick.

The Dashboard Widgets API (added in WP 2.7) makes it very simple to add new widgets to the administration dashboard. It only takes a few minutes to create a simple dashboard widget for your blogger. It can be a great way to make your plugin and themes even more useful.

How To Create A Custom Dashboard Widgets:

 This code would go in one of your plugin's files, or in your theme's functions.php:

/**
 * Add a widget to the dashboard.
 *
 * This function is hooked into the 'wp_dashboard_setup' action below.
 */
function example_add_dashboard_widgets() {

    wp_add_dashboard_widget(
                 'example_dashboard_widget',         // Widget slug.
                 'Name of your widget',          // Title.
                 'example_dashboard_widget_function' // Display function.
        );   
}
add_action( 'wp_dashboard_setup', 'example_add_dashboard_widgets' );

/**
 * Create the function to output the contents of our Dashboard Widget.
 */
function example_dashboard_widget_function() {

    // Display whatever it is you want to show.
    echo "<p>Welcome to BWidgets! Need help? Contact the developer <a href="mailto:yourusername@gmail.com">here</a>.</p>";

That's it! Red part in the above code is the title and content area of our widget. Don't forget to leave a comment if you need any help with this tutorial.

Friday 27 September 2013

How To Add Extra Fields To WordPress User Profile Page


Yesterday I post an article about removing some extra fields (AIM, Yahoo IM, and Jabber) from WordPress' user profile page area. It's time to dig even more deeper into this trick. It's time for us to learn about adding some extra fields to user profile page.

The code below will show you how to add additional Twitter and Facebook fields, but you can use it to add any other field that you like. Add following php code to your theme's functions.php file (from theme editor):

function my_new_contactmethods( $contactmethods ) {
// Add Twitter
$contactmethods['twitter'] = 'Twitter username (withour @';
//add Facebook
$contactmethods['facebook'] = 'Facebook';
return $contactmethods;
}
add_filter('user_contactmethods','my_new_contactmethods',10,1);


That's it.

Thursday 26 September 2013

How To Stop Users With AdBlock In Blogger/WordPress


Don't you hate it when a crappy extension is blocking you from getting the payoff of your hard work that you put on your blog? Not sure about you, but I really really hate that. More than AJ Styles-Dixie Carter's TNA Promo that I'm watching right now, it's good. Okay, it was a creative way to end the show.

Back to topic. Antiblock.org found a great script to stop users with AdBlock from viewing your website. Don't forget to check and support their awesome project. There is no bad in stopping users with AdBlock from viewing your site because we blogger needs to earn as much as we can for our hard work. It's not easy to run and manage a full time blog without revenues from ads. Here is how to do it:

Stop Users With AdBlock In Blogger/WordPress/HTML:

First of all, you can also use this script on any other blogging/site platform. It works everywhere, even on a HTML page.

For Blogger:

  • Visit Blogger > Template > Edit HTML.
  • Press Ctrl + F and search for ]]></b:skin> and paste below code above it:

#g207{position:fixed!important;position:absolute;top:0;top:expression((t=document.documentElement.scrollTop?document.documentElement.scrollTop:document.body.scrollTop)+"px");left:0;width:100%;height:100%;background-color:#fff;opacity:0.9;filter:alpha(opacity=90);display:block}#g207 p{opacity:1;filter:none;font:bold 16px Verdana,Arial,sans-serif;text-align:center;margin:20% 0}#g207 p a,#g207 p i{font-size:12px}#g207 ~ *{display:none}

  • Now press Save Template.
  • Now navigate to Blogger > Layout > Add Gadget, Click on HTML/JavaScript Gadget.
  • Paste the below code into it and press Save.

<script>(function(w,u){var d=w.document,z=typeof u;function g207(){function c(c,i){var e=d.createElement('i'),b=d.body,s=b.style,l=b.childNodes.length;if(typeof i!=z){e.setAttribute('id',i);s.margin=s.padding=0;s.height='100%';l=Math.floor(Math.random()*l)+1}e.innerHTML=c;b.insertBefore(e,b.childNodes[l-1])}function g(i,t){return !t?d.getElementById(i):d.getElementsByTagName(t)};function f(v){if(!g('g207')){c('<p>Please disable your ad blocker!<br/>This site is supported by the advertisement <br/> Please disable your ad blocker to support us!!! </p>','g207')}};(function(){var a=['Adrectangle','PageLeaderAd','ad-column','advertising2','divAdBox','mochila-column-right-ad-300x250-1','searchAdSenseBox','ad','ads','adsense'],l=a.length,i,s='',e;for(i=0;i<l;i++){if(!g(a[i])){s+='<a id="'+a[i]+'"></a>'}}c(s);l=a.length;for(i=0;i<l;i++){e=g(a[i]);if(e.offsetParent==null||(w.getComputedStyle?d.defaultView.getComputedStyle(e,null).getPropertyValue('display'):e.currentStyle.display)=='none'){return f('#'+a[i])}}}());(function(){var t=g(0,'img'),a=['/adaffiliate_','/adops/ad','/adsales/ad','/adsby.','/adtest.','/ajax/ads/ad','/controller/ads/ad','/pageads/ad','/weather/ads/ad','-728x90-'],i;if(typeof t[0]!=z&&typeof t[0].src!=z){i=new Image();i.onload=function(){this.onload=z;this.onerror=function(){f(this.src)};this.src=t[0].src+'#'+a.join('')};i.src=t[0].src}}());(function(){var o={'http://pagead2.googlesyndication.com/pagead/show_ads.js':'google_ad_client','http://js.adscale.de/getads.js':'adscale_slot_id','http://get.mirando.de/mirando.js':'adPlaceId'},S=g(0,'script'),l=S.length-1,n,r,i,v,s;d.write=null;for(i=l;i>=0;--i){s=S[i];if(typeof o[s.src]!=z){n=d.createElement('script');n.type='text/javascript';n.src=s.src;v=o[s.src];w[v]=u;r=S[0];n.onload=n.onreadystatechange=function(){if(typeof w[v]==z&&(!this.readyState||this.readyState==="loaded"||this.readyState==="complete")){n.onload=n.onreadystatechange=null;r.parentNode.removeChild(n);w[v]=null}};r.parentNode.insertBefore(n,r);setTimeout(function(){if(w[v]!==null){f(n.src)}},2000);break}}}())}if(d.addEventListener){w.addEventListener('load',g207,false)}else{w.attachEvent('onload',g207)}})(window);</script>

That's it!

For WordPress:

It's all same for WordPress. Just add following CSS & JavaScript code to your WordPress template:

CSS:

#g207{position:fixed!important;position:absolute;top:0;top:expression((t=document.documentElement.scrollTop?document.documentElement.scrollTop:document.body.scrollTop)+"px");left:0;width:100%;height:100%;background-color:#fff;opacity:0.9;filter:alpha(opacity=90);display:block}#g207 p{opacity:1;filter:none;font:bold 16px Verdana,Arial,sans-serif;text-align:center;margin:20% 0}#g207 p a,#g207 p i{font-size:12px}#g207 ~ *{display:none}

JavaScript:

<script>(function(w,u){var d=w.document,z=typeof u;function g207(){function c(c,i){var e=d.createElement('i'),b=d.body,s=b.style,l=b.childNodes.length;if(typeof i!=z){e.setAttribute('id',i);s.margin=s.padding=0;s.height='100%';l=Math.floor(Math.random()*l)+1}e.innerHTML=c;b.insertBefore(e,b.childNodes[l-1])}function g(i,t){return !t?d.getElementById(i):d.getElementsByTagName(t)};function f(v){if(!g('g207')){c('<p>Please disable your ad blocker!<br/>This site is supported by the advertisement <br/> Please disable your ad blocker to support us!!! </p>','g207')}};(function(){var a=['Adrectangle','PageLeaderAd','ad-column','advertising2','divAdBox','mochila-column-right-ad-300x250-1','searchAdSenseBox','ad','ads','adsense'],l=a.length,i,s='',e;for(i=0;i<l;i++){if(!g(a[i])){s+='<a id="'+a[i]+'"></a>'}}c(s);l=a.length;for(i=0;i<l;i++){e=g(a[i]);if(e.offsetParent==null||(w.getComputedStyle?d.defaultView.getComputedStyle(e,null).getPropertyValue('display'):e.currentStyle.display)=='none'){return f('#'+a[i])}}}());(function(){var t=g(0,'img'),a=['/adaffiliate_','/adops/ad','/adsales/ad','/adsby.','/adtest.','/ajax/ads/ad','/controller/ads/ad','/pageads/ad','/weather/ads/ad','-728x90-'],i;if(typeof t[0]!=z&&typeof t[0].src!=z){i=new Image();i.onload=function(){this.onload=z;this.onerror=function(){f(this.src)};this.src=t[0].src+'#'+a.join('')};i.src=t[0].src}}());(function(){var o={'http://pagead2.googlesyndication.com/pagead/show_ads.js':'google_ad_client','http://js.adscale.de/getads.js':'adscale_slot_id','http://get.mirando.de/mirando.js':'adPlaceId'},S=g(0,'script'),l=S.length-1,n,r,i,v,s;d.write=null;for(i=l;i>=0;--i){s=S[i];if(typeof o[s.src]!=z){n=d.createElement('script');n.type='text/javascript';n.src=s.src;v=o[s.src];w[v]=u;r=S[0];n.onload=n.onreadystatechange=function(){if(typeof w[v]==z&&(!this.readyState||this.readyState==="loaded"||this.readyState==="complete")){n.onload=n.onreadystatechange=null;r.parentNode.removeChild(n);w[v]=null}};r.parentNode.insertBefore(n,r);setTimeout(function(){if(w[v]!==null){f(n.src)}},2000);break}}}())}if(d.addEventListener){w.addEventListener('load',g207,false)}else{w.attachEvent('onload',g207)}})(window);</script>

That's it. You can also use this plugin to stop users with AdBlock with some extra options.

After adding above listed code your blog will look something like this:

Image courtesy of HackingUniversity.in

How To Remove User Contact Info From WordPress Profile Page


After writing bunch of articles about WordPress' wp-config.php file, it's time for me to write some articles about the powerful functions.php file. And I'll start from the start. In this post, I'm sharing a very simple and useful trick for WordPressers (WordPressers :p).

Most of us never ever used three fields on the WordPress profile page and so we want to remove those fields. They are the fields for AIM, Yahoo IM, and Jabber. It's time to get rid of these fields:

Add following php code to your theme's functions.php file (from theme editor):

add_filter('user_contactmethods','hide_profile_fields',10,1);
function hide_profile_fields( $contactmethods ) {
unset($contactmethods['aim']);
unset($contactmethods['jabber']);
unset($contactmethods['yim']);
return $contactmethods;
}


That's it..!!

Wednesday 25 September 2013

How To Change The Default WordPress Media Uploads Folder


I'm really loving all the wp-config.php tricks. We can do so much amazing stuff with just some little codes.

Before WordPress 3.5 you used to be able to change the upload directory path from the Settings menu in the dashboard. However, now you can't do anything like that from the settings option, but it’s still possible.

How to Change The Default WordPress Media Uploads Folder:

Open wp-config.php (located in root of WordPress installation) and add following code before the line that says require_once(ABSPATH.’wp-settings.php’);.

define( 'UPLOADS', 'wp-content/custom-path' );

Change wp-content/custom-path with your custom upload path. For example, you can can change it to wp-content/files. Don't forget to add the code before require_once(ABSPATH.’wp-settings.php’);.

Thursday 19 September 2013

3 Ways To Disable WordPress AutoSave


This is my second post of the day here on BWidgets, and it's also about Daniel Bryan wp-config.php file and WordPress AutoPost. This time I'll show you one three ways to disable WordPress AutoSave feature.

When editing a post, the changes you make are automatically saved every 2 minutes. You can also use our last trick to Modify AutoSave Interval.

By Editing wp-config.php File:

This is the easiest way to disable WordPress AutoSave feature. To modify autosave interval simply open wp-config.php (located in root of WordPress installation) and add following code to the end of file:

define('AUTOSAVE_INTERVAL', 86400);

We've set WordPress AutoSave interval to 86400 seconds which is an entire day. So this effectively disables the autosave functionality. Thanks to Jacob Nicholson for the idea.

By Editing post.php File:

This is the smartest way to disable AutoSave feature without any heavy codes. Thanks to Shane G. for sharing this trick on a WordPress forum.

  • Open your wp-admin/post.php file and wp-admin/post-new.php files.
  • You will find this line of code there:

wp_enqueue_script('autosave');

  • Add // to the beginning of this code. It'll look something like this:

// wp_enqueue_script('autosave');

The AutoSave option will be disabled for your existing and new posts.

By Editing functions.php File:

Last but not the least. This is the most preferred way to disable this feature, as we don't have to re-edit our post.php and post-new.php file after every WordPress update, nor we have to adjust AutoSave interval. This trick will simple disable AutoSave feature. Thanks to Egill R. Erlendsson for sharing this trick on a WordPress forum.

Simple throw this in your functions.php file:

add_action( 'admin_init', 'disable_autosave' );
function disable_autosave() {
        wp_deregister_script( 'autosave' );
}

That's it folks. Thanks for all amazing guys that I mentioned on the article for sharing these amazing tricks around the internet. Don't forget to give us a backlink if you're sharing this article on your blog.

Modify WordPress AutoSave Interval


Here we're again! Another post about my favorite Pokemon WordPress core file. YES! YES! YES, this post is also about Daniel Bryan wp-config.php file.

When editing a post, the changes you make are automatically saved every 2 minutes. It seems bit weird, but you can actually change the setting for longer delays in between auto-saves, or decrease the setting to make sure you never lose changes.

And we don't need a crappy plugin for this simple hack. Technically, it's not even a hack, but a simple option described in original WordPress codex.

Modify WordPress AutoSave Interval:

To modify autosave interval simply open wp-config.php (located in root of WordPress installation) and add following code to the end of file:

define('AUTOSAVE_INTERVAL', 160 );  // seconds

Replace 160 with your custom autosave interval (in seconds).

Save your config.php file & that's it!

Friday 13 September 2013

How To Disable Or Limit WordPress Post Revisions

Post Revisions are a feature introduced in WordPress 2.6. A revision is automatically stored in your database, whenever you save or draft a post or a page. Earlier this year, I posted an article about Deleting Old WordPress Post Revisions at this link.

Today we're going to learn a very simple tweak to disable or limit WordPress post revisions without installing any crappy plugin, which saves a lot of space. We just have to add a little snippet to your our config.php file.

Limit WordPress Post Revisions:

To limit Post revisions simply open wp-config.php (located in root of WordPress installation) and add following code to the end of file:

define('WP_POST_REVISIONS', 3);

Replace 3 with maximum number of Post revisions per post/page.

Disable WordPress Post Revisions:

To disable Post revisions simply open wp-config.php (located in root of WordPress installation) and add following code to the end of file:

define('WP_POST_REVISIONS', false );

 Save your config.php file & that's it!

Monday 9 September 2013

Editing WordPress wp-config.php File


Editing WordPress core files is a very risky and hard job, especially for WordPress beginners like me. Yea, I'm using WordPress only from last four months, but I have learned a lot from it.

The wp-config.php file is one of the most important files in WordPress. It contains the login information for WordPress to connect to your database as well as table prefix, secret keys, e.t.c. Editing wp-config.php file is very easy, but this file looks a bit scary so beginners usually keeps themselves away from it.

If you installed WordPress using your hosting provider's install wizard, then wp-config.php file will be in your root directory. If you installed WordPress using FTP, then you can find wp-config.php (named as wp-config-sample.php) file in your WordPress download. Don't forget to rename wp-config-sample.php to wp-config.php.

Adding Database Info:

To change the wp-config.php file for your installation, you will need this information:

Database Name
Database Name used by WordPress
Database Username
Username used to access Database
Database Password
Password used by Username to access Database
Database Host
The hostname of your Database Server. A port number, Unix socket file path or pipe may be needed as well. 

Find following lines in your wp-config.php file:

define( 'DB_NAME',     'database_name_here' );
define( 'DB_USER',     'username_here' );
define( 'DB_PASSWORD', 'password_here' );
define( 'DB_HOST',     'localhost' );

It's not that hard. We just have to replace above text with our database's info.

Set Database Name:

Replace 'database_name_here', with the name of your database, e.g. MyDatabaseName.

define( 'DB_NAME', 'MyDatabaseName' );

Set Database User:

Replace 'username_here', with the name of your username e.g. MyUserName.

define( 'DB_USER', 'MyUserName' );

Set Database Password:

Replace 'password_here', with the your password, e.g. MyPassWord.

define( 'DB_PASSWORD', 'MyPassWord' );

Set Database Host:

Replace 'localhost', with the name of your database host, e.g. MyDatabaseHost.
define( 'DB_HOST', 'MyDatabaseHost' );

That's it for this part. Now we have to follow one simple step to complete our wp-config.php file.

Adding Secret Keys:

Now we just have to add some unique keys to our wp-config.php file. Find following in your wp-config.php file:

define( 'AUTH_KEY',         'put your unique phrase here' );
define( 'SECURE_AUTH_KEY',  'put your unique phrase here' );
define( 'LOGGED_IN_KEY',    'put your unique phrase here' );
define( 'NONCE_KEY',        'put your unique phrase here' );
define( 'AUTH_SALT',        'put your unique phrase here' );
define( 'SECURE_AUTH_SALT', 'put your unique phrase here' );
define( 'LOGGED_IN_SALT',   'put your unique phrase here' );
define( 'NONCE_SALT',       'put your unique phrase here' );

Put your unique keys in above spaces. You don't have to remember the keys, just make them long, random and complicated. You can change these keys at any time. You can also use WordPress' online generator to automatically generate these keys for you.

These secret key protects your site from getting hacked. A password like "password" or "facebook" is simple and easily broken. A random password such as "w<$4c$aPHmd%/*]`Oom>(hpdXW|0M=X={we6;Mphvtg+V.o<$|#_}qG(GaVDEsn,~*4i')" takes years to come up with the right combination.

That's it for this time. Now after adding/editing above details, your wp-config.php file is ready for some action. You can now save/update the file to your file manager's root directory to see it in action.

Wednesday 4 September 2013

How To Remove WordPress Admin Bar Without Plugin


A blogger friend asked me about removing WordPress' admin bar without any plugin because he wanted to get rid of all small plugins from his directory. So I found this amazing php code on dfactory.eu.
Put any of the following codes in your Theme's function.php file:

Disable Admin Bar For Everyone:

// Disable Admin Bar for everyone
if (!function_exists('df_disable_admin_bar')) {

    function df_disable_admin_bar() {
       
        // for the admin page
        remove_action('admin_footer', 'wp_admin_bar_render', 1000);
        // for the front-end
        remove_action('wp_footer', 'wp_admin_bar_render', 1000);
         
        // css override for the admin page
        function remove_admin_bar_style_backend() {
            echo '<style>body.admin-bar #wpcontent, body.admin-bar #adminmenu { padding-top: 0px !important; }</style>';
        }     
        add_filter('admin_head','remove_admin_bar_style_backend');
       
        // css override for the frontend
        function remove_admin_bar_style_frontend() {
            echo '<style type="text/css" media="screen">
            html { margin-top: 0px !important; }
            * html body { margin-top: 0px !important; }
            </style>';
        }
        add_filter('wp_head','remove_admin_bar_style_frontend', 99);
      }
}
add_action('init','df_disable_admin_bar');

Disable Admin Bar For Everyone But Administrators:

// Disable Admin Bar for everyone but administrators
if (!function_exists('df_disable_admin_bar')) {

    function df_disable_admin_bar() {
       
        if (!current_user_can('manage_options')) {
       
            // for the admin page
            remove_action('admin_footer', 'wp_admin_bar_render', 1000);
            // for the front-end
            remove_action('wp_footer', 'wp_admin_bar_render', 1000);
           
            // css override for the admin page
            function remove_admin_bar_style_backend() {
                echo '<style>body.admin-bar #wpcontent, body.admin-bar #adminmenu { padding-top: 0px !important; }</style>';
            }     
            add_filter('admin_head','remove_admin_bar_style_backend');
           
            // css override for the frontend
            function remove_admin_bar_style_frontend() {
                echo '<style type="text/css" media="screen">
                html { margin-top: 0px !important; }
                * html body { margin-top: 0px !important; }
                </style>';
            }
            add_filter('wp_head','remove_admin_bar_style_frontend', 99);
           
        }
      }
}
add_action('init','df_disable_admin_bar');

Disable Admin Bar For Specific Users:

// Disable Admin Bar for specific user
if (!function_exists('df_disable_admin_bar')) {

    function df_disable_admin_bar() {
       
        // we're getting current user ID
        $user = get_current_user_id();
       
        // and removeing admin bar for user with ID 123
        if ($user == 123) {
       
            // for the admin page
            remove_action('admin_footer', 'wp_admin_bar_render', 1000);
            // for the front-end
            remove_action('wp_footer', 'wp_admin_bar_render', 1000);
           
            // css override for the admin page
            function remove_admin_bar_style_backend() {
                echo '<style>body.admin-bar #wpcontent, body.admin-bar #adminmenu { padding-top: 0px !important; }</style>';
            }     
            add_filter('admin_head','remove_admin_bar_style_backend');
           
            // css override for the frontend
            function remove_admin_bar_style_frontend() {
                echo '<style type="text/css" media="screen">
                html { margin-top: 0px !important; }
                * html body { margin-top: 0px !important; }
                </style>';
            }
            add_filter('wp_head','remove_admin_bar_style_frontend', 99);
           
        }
      }
}
add_action('init','df_disable_admin_bar');

That's it!

Saturday 27 July 2013

Image Grabber (Remote Image Uploader) Plugin For WordPress


It's really irritating to manually download and update images from an another website to your own website. It takes to much time and data to do that. Remote image uploading setting makes it easy to upload any type of image from a link.

I recently found a great plugin for this job on CodeCanyon, but it was a premium plugin. So I searched on Plugin Directory with several different names and finally found a perfect plugin.

It's called, Remote Images Grabber, you can download this plugin at this link. Here is the original description of this plugin:

Fetches images from an URL or a piece of html-code, saves them directly into your blog media directory, and attaches to the appointed post. 

After installing this plugin, you'll get an option in your media upload dialog to directly upload images from a link to your blog.

How To Install Image Grabber:

  • Click here and download this plugin. Visit your WordPress' plugin page and install this plugin.
  • You can also install this plugin from your WP's plugin directory.
  • After installing, activate the plugin through the 'Plugins' admin menu in WordPress.

That's it for this time. Comment if you're having any troubles.

Monday 22 July 2013

Adding Username Availability Checker To BuddyPress



Picking a username is a very hard task for everyone. So this plugin allows you to check for the availability of a user name on BuddyPress registration page. It's very useful plugin and it also gives a pro look to your BuddyPress registration page.

It makes easy for your readers to pick a suitable username, without refreshing the page. This plugin is developed by Brajesh Singh of BuddyDev.com.

How To Install BPDev Username Availability Checker:

  • Click here to download this plugin.
  • Go to WordPress Dashboard > Plugins > Add New > Upload
  • Upload .zip file that you downloaded from the first step.
  • Upload/Install and activate the plugin “Username Availability Checker”

Now it's time to check this plugin by logging out of your BuddyPress account. That's it for this time. Don't forget to join BuddyDev Premium Club for more BuddyPress plugins.

Sunday 7 July 2013

How To Automatically Tag WordPress Posts


Tagging posts in WordPress is an another great way to make time traveling navigation more easy for your readers. It's a useful way to group related posts together. Tags are similar to, but more specific than, categories.

Tagging your new posts is very easy, but it's really a huge pain if you post way too much on your blog, or when it comes to tag previously posted posts.

As expected, there are several plugins, which automatically add tags to your WordPress posts. But it's really hard to find them in that crowded plugin directory. So, here are my two favorite plugins for this task.

1. Strictly Auto Tags:

Strictly Auto Tags is a very useful plugin by Strictly Software, which automatically adds the most relevant tags to your posts. I'm using this plugin on my wwefansnation.com, and it's a very helpful plugin for me. It scans an English language post for words that could be used as tags and then orders them so that the most relevant words get added. It won't add any grammar or useless words to your tags. This plugin is only designed for English language blogs.

2. Automatic Post Tagger:

This plugin is very different from Strictly Auto Tags plugin. In this plugin, you have to create a list of tags with related words for each of them and it'll add relevant tags automatically when a post is published or updated. You can also configurable maximum number of tags per post.

Got a great WordPress plugin? Don't forget to share with us in the comment section below, or you can also use our contact page to share them with us.

Tuesday 25 June 2013

How To Add Polls To WordPress



Polls are a great way to find out what your readers thinks about a specific thing or topic. Because your reader's opinion really matters, or maybe we just say that, but polls are a must have feature for all topic based sites.

By using polls, you can know your reader's interest, opinion, and many things. It all depends on how you use them. It's WordPress and you can also use polls in your posts, sidebars, or on an poll archive page.

So there are lots of plugins to add free polls on your WordPress site, but which one is best for us? It's not a really hard question - you can use WP Polls, which is free and fantastic. Official description of WP Polls reads:

Adds an AJAX poll system to your WordPress blog. You can also easily add a poll into your WordPress's blog post/page.

It's very great plugin to use, and you can also add a poll into your blog's posts, pages, or on sidebar widgets. It's extremely customizable via templates and css styles. It also gives you an option to set a Polls Archive page for your site to display all our current and old polls. Let's just get started with this plugin:

Installing WP Polls to WordPress:

  • Click here and download this plugin. Visit your WordPress' plugin page and install this plugin.
  • You can also install this plugin from your WP's plugin directory.
  • After installing, activate the plugin through the 'Plugins' admin menu in WordPress.

That's with this simple part. Now let's move on to second part.

How To Add A Poll:

After installing this plugin, WP Poll menu will appear in your WordPress's right menu section. You can add a new poll by simply clicking on that menu. You can also choose poll's expiring time, starting time, more. Just add your poll and click on Add Poll button.

Now visit Widget section of your WP, and add a WP Poll widget to your blog's sidebar, or wherever you want your poll to appear. You can also add your poll into a post or page by clicking on Poll icon in post/page editor.

You can also display WP Poll into your template by adding following php code into your template:

<?php if (function_exists('vote_poll') && !in_pollarchive()): ?>
    <li>
        <h2>Polls</h2>
        <ul>
            <li><?php get_poll();?></li>
        </ul>
        <?php display_polls_archive_link(); ?>
    </li>
<?php endif; ?>

You can get more details at this link.

Creating Poll Archive:

Creating a Poll Archive page for your blog is a great idea, and I really recommend this step. It's just too easy, you just need to enter a simple code into your page.

  • Create a new page and name it Polls or Poll Archive
  • Change page's permalink to: http://www.yourblog.com/pollsarchive/
  • Just put following code into your page and publish it:

[page_polls]

That's it! Don't forget to leave a comment!

Friday 14 June 2013

How To Delete Unconfirmed WordPress Users



In past, I shared several articles to manage your WordPress users, such as changing usernames, and restricting usernames. It's time for another article related to WordPress users. It's really important to manage all users, even more if you're using BuddyPress.
Some registered users of your site may not really confirm their id by clicking on activation links, which really sucks, as they're just wasting your database's little space. Activation emails may be caught by spam filters, deleted unwillingly, or simply not understood.

Boone Gorges and CUNY Academic Commons created a very useful plugin called, Unconfirmed, which creates a Dashboard panel under the Users menu (Network Admin > Users on Multisite) that shows a list of unactivated user registrations.

For each registration, you can resend the original activation email, manually activating the user, or delete them. It's a really great and must use plugin for all. If you got some extra money, you can also donate some to keep this plugin up in development at this link.

How To Install And Use Unconfirmed:

  • Click here and download this plugin. Visit your WordPress' plugin page and install this plugin.
  • You can also install this plugin from your WP's plugin directory.
  • After installing, activate the plugin through the 'Plugins' admin menu in WordPress.
  • Now visit Dashboard > Users to manage unconfirmed users.

Hope this will keep your community up and clean. Don't forget to leave your responses, and I'll try to help and reach you all.

Monday 10 June 2013

How To Restrict Usernames In WordPress


It's really hard to run a WordPress blog, with BuddyPress and public registration. I'll post several article about managing your WordPress and BuddyPress users on BWidgets. Today, we'll kick off this series with a very basic tutorial.

In this tutorial, we'll learn about how to restrict usernames from your WordPress, so people may not use when registering for your site. By default, WordPress allow users to pick any username they choose as long as it isn't an already existing account and it doesn't include invalid characters.

Scott Reilly created a great plugin to restrict some usernames so they may not pick it. It's very important to restrict several usernames, including contact, admin, feedback, user, moderator, and more.

When attempting to register with a restricted username, vistors will see an error notice that says: ERROR: This username is invalid. Please enter a valid username.

How To Install And Use Restrict Usernames:

  • Click here and download this plugin. Visit your WordPress' plugin page and install this plugin.
  • You can also install this plugin from your WP's plugin directory.
  • After installing, activate the plugin through the 'Plugins' admin menu in WordPress.
  • Go to the Users -> Name Restrictions admin settings page (which you can also get to via the Settings link next to the plugin on the Manage Plugins page) and specify username restrictions.

That's IT! You can put your responses, problems and requests in the comment section below... :)

Wednesday 5 June 2013

Adding reCAPTCHA To BuddyPress Registration

We all hate spam and spammer way too much. They always annoy us everywhere on internet, our blogs, comments, Facebook, Twitter, forums, and everywhere. It's a great idea to prevent some of these spammers by using a CAPTCHA. It's impossible for them to pass a CAPTCHA, since they're just a spam bot without any brain.

Google's reCAPTCHA is a great way to knock these spammers out. Over 200,000 sites use reCAPTCHA, including household names like Facebook, Ticketmaster, Twitter and Craigslist. I have added a reCAPTCHA on my BuddyPress' registration at this link. It also looks good and professional. It's easy to add reCAPTCHA to your BuddyPress' registration page, you just need to read this tutorial carefully. Here we go:

Installing BuddyPress reCAPTCHA:

First we must install BuddyPress reCAPTCHA on our WordPress. You can download this by clicking here.

  • Click here and download this plugin. Visit your WordPress' plugin page and install this plugin.
  • You can also install this plugin from your WP's plugin directory.
  • After installing, just click on active.

Finish with this part. Now, first we'll create our reCAPTCHA keys then we'll add our key to this plugin. This doesn't have a user panel, so we have to do it manually. Let's start our second step:

Getting Our reCAPTCHA Keys:

Now we need two reCAPTCHA keys from their website - first is public key, and second is a private key. Here is how to get both of these:

  • Visit this link and login with your Google Account.
  • Following form will appear, fill this form with your website url and click on Create Key:


  • Now after clicking on Create Key,  you'll get both keys - public key, and the private key. Now copy these codes into a notepad document, and check next step:

Adding reCAPTCHA Keys To BuddyPress:

It's final step, and it's not that hard.You must edit the 'bp-recaptcha.php' file to make your settings.

  • Visit your WordPress Dashboard > Plugins > Edit Plugins
  • Choose BuddyPress reCAPTCHA plugin
  • Now choose bp-recaptcha.php file
  • In bp-recaptcha.php add your your public key and private key in following spaces:


  • Click on Update/Save and That's IT!
Don't forget to leave your responses. Also guys, you can check full personal blog at this link.

Popular Posts

 
Powered by Blogger.