How To Resize Multiple Images At Once Using Picasa

Sometimes you might need to resize multiple images at once. But by default there is no such built in Operating System option which will allow you to do so.

Now you might ask me why would someone want to resize multiple images at once? Well, I don’t know, maybe to fit several images in a CD drive or USB drive. Or maybe just scale down several images so that the e-mail recipients can load the images faster.

Well you can do this with the help of Software called Picasa. I’m sure most of you are already familiar with Picasa. If you don’t have Picasa, you can get it Over Here.

To Scale or Re-size multiple images follow the steps given below –

  • Open Picasa (very obvious but yeah.. just open it ..)
  • Select the photos which you want to scale.
  • Go to the File menu and choose “Export Picture to Folder…”
  • The following dialog box appears –

 Resize Multiple Images At Once Using Picasa

  • You can adjust the settings here, like select the location where you want to save the scaled images, specify the new size in pixels and adjust the image quality as well.
  • After you are done, just hit Ok button.
  • You will get the scaled images in the selected export folder location.

If you have any doubts or questions, feel free to comment below. Thanks.

How To Edit Robots.txt In WordPress

Do you know how to edit robots.txt file in WordPress? if not then you must know. Because this file tells the search engines, if they should index your site or not.

Note that, this file just tells or requests the search engine bots with a note saying whether they are allowed or disallowed to index a certain page on your site. But in the end its their decision of whether they should index your site or not.

Many WordPress users face various complications while trying to editing the robots.txt file. So in this post i’ll share two easy ways to edit robots.txt.

One way is to create a new robots.txt file and upload it to the server and the other way is by using a simple WordPress plugin which will help you to edit robots.txt directly in your web browser.

#1. Create robots.txt

  1. Create new notepad file
  2. Add your desired contents inside it.
  3. For example content, you can find my robots.txt at http://www.codefap.com/robots.txt
  4. Save the file as robots.txt – Don’t misspell it.
  5. Upload it to the root directory of your site using FTP or File Manager.

#2. Using Plugin

If you want to edit robots.txt directly through the Administrator Dashboard then you can simply use this plugin – WP Robots Txt

This plugin makes it very easy to access and edit robots.txt file. I’d recommend it.

How To Change Default Color Palette In WordPress

I was wondering if we can change the default color palette in WordPress. And after a bit of research i figured out how to do that.

I wanted to customize or change the default color palette because whenever i needed to put a custom color to the text, i had to waste about 20-25 seconds to manually select a custom color from the more color option.

It was really a time consuming process to select a custom color which i needed frequently in my blog posts. And this post exactly helps to solve that issue.

Given below is a screenshot of how i customized the look of my color palette in the tinyMCE editor of WordPress.

Change Default Color Palette In WordPress

How To Customize Color Palette in TinyMCE Editor

Now this can be explained in three simple steps (if you are an advanced user then these 3 steps are sufficient for you, if not – check additional info).

  1. Find and extract wp-includes/js/tinymce/wp-tinymce.js.gz.
  2. Open the file wp-tinymce.js in notepad and find (CTRL+F) the string ‘000000‘. Now you will find a list of colors in hex code. Just replace these with your desired hex color code.
  3. Save the file and then archive it in GZIP format (important) and upload it back to the server.

Additional Info

The file wp-tinymce.js is encoded in GZIP format which is located at wp-includes/js/tinymce/wp-tinymce.js.gz. The gz at the end indicates that its a GZIP encoded version of wp-tinymce.js file.

You have to download the wp-includes/js/tinymce/wp-tinymce.js.gz file from the server, extract it and edit it in notepad to change default color palette by adding your own custom colors.

When you open the file in notepad, just go ahead and find 000000 inside the file. This is where you will find a list of all default colors which are in the color palette of tinyMCE editor of WordPress.

But these are hex codes, which means 000000 represents black color. Similarly, ff0000 represents red color. So for instance, if you want to replace black with red, then you have to replace 000000 in the file with ff0000.

Once you make the necessary changes, just save the file. And now comes the difficult part of this procedure.

Once you save, you have to archive the file in the GZIP format. Check this article to know – how to GZIP a file in Windows. When you are done, the next step is to upload the file back to the server and replace the existing one.

This will give you a custom color palette for WordPress tinyMCE Editor. I hope this helps and for more amazing posts, subscribe to blog feed.

How To Fix – There Is No Attribute “allowTransparency”

If you are getting a message ‘There is no attribute allowTransparency‘ while validating your site with W3C Validator then this post is for you.

If you are using document type XHTML Transitional then maybe i can solve your problem. The attribute allowTransparency belongs to iframe. So we will be taking up a short code containing iframe tags with the attribute allowTransparency in it.

The best example would be Facebook Like Box, because most blogs and websites use it and it fails to validate with W3C Validator.

The code for Facebook like box with Page Username Codefap is given below –

But this code fails to validate for the only reason that it contains allowTransparency attribute. And this can be simply fixed by replacing the code given above with the following code –

We have written two codes for the Facebook Like Box – One with allowTransparency with if statement for IE and other one without it. And this solves the problem. By using this embed code with conditional HTML elements, you can validate your site properly even after using allowTransparency attribute on the web page.

Manually Reset WordPress User Password Using PhpMyAdmin

It is important that you should know how to reset WordPress user password by editing the database. If  – 1) you forget wordpress account password, 2) your wordpress account gets hacked, 3) you cannot reset wordpress password by e-mail – then this post can be very useful.

I had once forgotten my user password for a local WordPress installation based on WAMP Server. I had a clue that i can reset the password by using phpmyadmin but even though i tried, it just didn’t work.

In this post i will tell you why it didn’t work and also how to get it to work. First of all you must know how to access phpmyadmin

If you are using WordPress local installation based on WAMP Server then you can find phpmyadmin just by visiting the URL given below.

http://localhost/phpmyadmin/

But if you are using CPANEL hosting, then you can find phpmyadmin just in the databases category as shown below.

phpMyAdmin in CPANEL

Note – If you are an advanced user, you can just follow this article by referring to images plus bold red/green text instead of spending too much time reading every line.

#1) Once you open phpMyAdmin, just Select Databases from top left corner and you will get a screen similar to the one given below.

Select A Database

#2) All you need to do is Select the Appropriate WordPress Database. In this case, I am selecting cflocal which is used by my local WordPress installation. After doing so, you will get the next screen as shown below.

Select wp_users

#3) Now Select wp_users to edit users table.

Edit Users Table

Since my local WordPress installation has just one user named admin, you can only see one row. But if you have several users then you will get multiple rows here.

#4) Just hit the edit button next to the user upon which you want to perform the reset password operation. This will show up the next screen given below.

Edit User Pass Window

Here you can see the user_pass row has a weird set of characters as the value. This is just for security reasons.

Note: If you try to set a new password by entering a new value and hitting go button, then it just wont work. Because you need to set a MD5 value instead of normal value.

#5) Enter a new password value in user_pass row and select Md5 Function from drop down menu as shown below.

MD5 Password WordPress

#6) Now just hit the Go button and you are done. Your password will be reset.

If it doesn’t work or if you have any doubts then feel free to comment below. And do subscribe to blog feed for more amazing posts. Thanks.

How To Detect Homepage In WordPress

Sometimes you might want to detect whether the current WordPress page is home page or not. This can be helpful if you want to display/hide certain content of your blog. For example – hide advertisements on home page, display a welcome message, etc.

Now there are different ways to do this. I’ll try and explain all of these in this post.

WordPress has two inbuilt functions is_home() and is_front_page() which can help you to detect homepage in WordPress. Lets understand how to use them –

is_home()

If you are not using a static home page, then this is the function which can help you to detect whether the current page is home page or not. You can use the code given below to display content only on homepage and hide from all other pages.

is_front_page()

If you are using a static home page then instead of is_home() function, you have to use is_front_page() function. And the code to detect home page is given below.

Problem with Widgets

The is_home() and is_front_page() might not work well if you place them or use them inside the widgets or widget functions. And to solve that we can just get rid of WordPress functions and directly use URI (Uniform Resource Identifier) check method as given below.

Direct URI Check

Instead of WordPress methods, I’d recommend you guys to use the code given below.

Just replace line number 3 with your desired code. This code works reliably well on all WordPress pages. I hope this works out for you guys. If you have any doubts feel free to comment below.

And for more amazing posts, Subscribe to Blog Feed.

How To Disable AdSense Ads To Logged In WordPress Users

If you are running AdSense Ads on a WordPress blog then you might wanna disable Advertisements for logged in WordPress users.

If ads are enabled to logged in WordPress users then the author might indirectly inflate ad impressions or he might click on a Ad by mistake.

This can be a serious issue since inflating ads or clicks is strictly against Google AdSense Policies. So its better to disable ads to logged in WordPress users.

Also if you target the advertisements only towards visitors instead of authors then it can dramatically increase the performance of ads on your website.

So in this post i will share how to disable AdSense ads to logged in WordPress users as well as how to disable ads on Post Preview Page.

#1) Disable Ads Only For Logged In Users

Include the following Code to display Adsense Ads. Just put the advertisement code inside the PHP conditions. So the AdSense advertisement will be only displayed to logged in WordPress users.

This will work in any .php file like Single Post file. But if you are placing an advertisement in Widget then this fails because the code is PHP.

If you want this to work in Widgets then you can use a plugin called ‘Executable PHP Widget’.

If you don’t want to use any plugin then check my post on how to execute PHP code in WordPress widget.

 #2) Disable Ads In Preview Mode

To disable advertisements in preview mode, you have to again use the same concept of PHP condition but slightly different code. This code simply checks if preview mode is on or not. If not then displays the advertisement.

And again since this is a PHP code, it won’t work in Widget unless you use a plugin or modify the functions of your theme.