World of information, opinions, cricket and technology.

How to Highlight Special Paragraphs or Sentences in the post or article

Thursday, June 4th, 2009

Few days back, Atul from Ocean of Web left a comment at How to Block Visitors from specific IP using .htaccess hack.

This is what he asked :

Hi Nihar
Make sure you backup .htaccess file before you making any changes.

for this line in red color box with cross mark, are u using any plugin for this

You can check the comment here

In above post where he left the comment, I have put the following:

Make sure you backup .htaccess file before you making any changes.

Today, i am going to share the CSS and images and also tell you how you can add these Custom Paragraphs or Sentences to highlight them in your Blog post

How to add Custom Paragraphs or Sentences in your Blog post

  1. First open your Theme's style.css file and then copy the below CSS snippet at the end of the file. Note: all themes doesn't have css filename as style. So, check accordingly.
    .info {font-size: 11px;color: #191919;background: #ebe9ce url(images/info.gif) no-repeat 5px center;font-family: Verdana, sans-serif, "Courier New";line-height: 125%;margin: 10px 0px 0px;padding: 12px 12px 12px 25px;display: block;font-weight: 400;width: 80%;border-top: 2px solid #DAD6A5;border-bottom: 2px solid #DAD6A5;}
    .warning {font-size: 11px;color: #191919;font-family: Verdana, sans-serif, "Courier New";line-height: 125%;background: #e3aeae url(images/warning.gif) no-repeat 5px center;display: block;margin: 10px 0px 0px;padding: 12px 12px 12px 25px;font-weight: 400;width: 80%;border-top: 2px solid #D68585;border-bottom: 2px solid #D68585;}
    .download {font-size: 11px;color: #191919;font-family: Verdana, sans-serif, "Courier New";line-height: 125%;background: #d5ecd5 url(images/download.gif) no-repeat 5px center;display: block;margin: 10px 0px 0px;padding: 12px 12px 12px 25px;font-weight: 400;width: 80%;border-top: 2px solid #A9D8A9;border-bottom: 2px solid #A9D8A9;}
    .alert {font-size: 11px;color: #191919;line-height: 125%;background: #FFE5BF url(images/alert.gif) no-repeat 5px center;font-family: Verdana, sans-serif, "Courier New";display: block;margin: 10px 0px 0px;padding: 12px 12px 12px 25px;font-weight: 400;width: 80%;border-top: 2px solid #FFC46A;border-bottom: 2px solid #FFC46A;}
    .note {font-size: 11px;color: #191919;font-family: Verdana, "Times New Roman", Times, Georgia, serif;line-height: 125%;background: #eaf2f5 url(images/note.gif) no-repeat 5px center;display: block;margin: 10px 0px 0px;padding: 12px 12px 12px 25px;font-weight: 400;width: 80%;border-top: 2px solid #B7D2DD;border-bottom: 2px solid #B7D2DD;}
    .click {font-size: 11px;color: #191919;font-family: Verdana, "Times New Roman", Times, Georgia, serif;line-height: 125%;background: #fcfbed url(images/click.gif) no-repeat 5px center;display: block;margin: 10px 0px 0px;padding: 12px 12px 12px 25px;font-weight: 400;width: 80%;border-top: 2px solid #F2EDB0;border-bottom: 2px solid #F2EDB0;}
  2. Now, if you check the above css code. It is using some images. Below, i am providing the images.zip file. Please download it and upload it in your THEME DIR/images/ directory. If you don't see images directory under your THEME directory, then create one and extract the images from the images.zip file.

    Download Images for above CSS code

(more...)

How to Block Visitors / Traffic from a Specific Country

Tuesday, June 2nd, 2009

There are times when you don't want the Visitors or Traffic to your Website or Blog from a Specific Country.

What could be the reason for blocking a country or countries?

Your site may have data that you don't want to expose to some countries or your site is getting lot of abuses from a country. There could be any other reason as well. In such cases the site owner or Blog owner would want to block the unwanted traffic from a country.

How to Block Visitors or Traffic from a Country?

(more...)

How to Block Visitors from specific IP using .htaccess hack

Tuesday, May 26th, 2009

I am sure most of the Website owners or Blog owners have faced this problem. Some visitor is nasty or jealous and wants to trouble by posting abusive comments or do harm to the website.

One of the solutions is to Block or Deny the access to your Blog or website.

Yes, you can block a Visitor of your website. Read on to know how to do that....

Block Visitor from Specific IP Address using .htaccess Hack

I am assuming that you know about .htaccess file. It resides in the root directory of your website. The root directory could be /www/, /httpdocs/ or /public_html/ directories. Any of them depends on the hosting service.

Make sure you backup .htaccess file before you making any changes.

  • Grab the IP Address of that visitor by checking your favourite Stats webservice. I use StatCounter to get the IP Address or Wordpress Dashboard (if the visitor has left a comment).
  • Login to your hosting service site and open code>.htaccess file. Make sure you backup the file before making any changes.
  • Lets say i want to block a Visitor coming from this IP Address 120.120.120.120. I will add the below entry in .htaccess at the end of the file.
    deny from 120.120.120.120
  • Now save the file

If you want to block more visitors, just keep adding the ip addresses in .htaccess file .

In this way, you can also block the automated spammer.

If you know any other way, please share via comments. Hope you learned something from this post!

Technorati Tags: ,

How to Remove Wordpress Meta Generator tag

Thursday, May 14th, 2009

I was reading an excellent post How to Stop Your WordPress Blog Getting Hacked. In that, the author has listed out different ways on how you can stop your Wordpress Blog getting hacked.

The second point in that post is to "Remove Meta Generator Tag". This tag reveals the Wordpress Version you are using. This is the reason to remove that tag.

As instructed, i headed to header.php of my current theme and looked for the following line to remove it.

<meta name="generator" content="WordPress 2.7" />

I was surprised to see that line was not there but, it was getting generated when i view the source of my Blog.

I then found a way to Remove Wordpress Meta Generator tag.

If you look the contents of header.php carefully, you will find a function call wp_head() just before tag. This is the function which is adding Wordpress Meta Generator Tag.

Our aim is to remove that tag from getting generated by wp_head() function.

Following steps are to remove meta generator tag in wordpress:-

(more...)

How to set CapsLock, NumLock and ScrollLock Keys On/Off using Windows Registry Tweak

Wednesday, March 11th, 2009

Most of the Windows users have preference on whether "CapsLock", "NumLock" or "ScrollLock" keys should be turned on or off after Windows has started.

I prefer NumLock to be in On status and CapsLock in Off status after windows has completed started.

What if your preference is not same as the default settings that Windows? Below is the tip by which you can do changes in Windows Registry to permanently change the settings according to your preference!

Below are the steps to change the ON/OFF Status of CapsLock, NumLock and ScrollLock Keys:
(more...)