convert plain text URI to HTML links in wordpress themes

When you put some URL and email address you need to manually add the link URL to that text. This action always takes the some time of wordpress blogger. WordPress has facility to add the links to your URL and email address automatically.

 

convert plain text URI to HTML links in wordpress

This facility is available in wordpress since wordpress 2.7 version but many wordpress theme and plugin developers never used this functionality.

WordPress provides the make_clickable() function for convert plain text URI to HTML links. This function able to convert URI, www, ftp, and email addresses. Finishes by fixing links within links. You just need to pass the string parameter to this method.

More detail information you can find in following file.
wp-includes/formatting.php.

You can use this method in your functions.php file also. Use the following code.

add_filter('the_content', 'make_clickable');

By using this code you are able to covert the URI, www, ftp, and email addresses in to link.

If you are having any issues or question about make_clickable method then please write to me.

most popular posts wordpress without plugin

Many times you want to show the popular posts in your wordpress theme and you use popular post wordpress plugin or widget for showing the popular posts in your wordpress theme. As much possible you need to avoid the wordpress plugins for minimal code.

most popular posts wordpress without plugin

With very easy steps you can fetch the most popular posts from your wordpress. Most common trick or technique is on comments base you can fetch the popular posts.

You just need to open your functions.php file from wordpress posts and put following code in file.


// Get Most Popular Posts in theme
function popular_posts_by_comments( $posts = 5) {
 $popular = new WP_Query('orderby=comment_count&posts_per_page='.$posts);
 while ($popular->have_posts()) : $popular->the_post();
?>
<li>
<div>
 <a title="<?php the_title(); ?>" href="<?php the_permalink() ?>"><?php the_title(); ?></a>
 <span><?php comments_popup_link('0 Comment', '1 Comment', '% Comments', 'comments-link', ''); ?></span>
 </div> <!--end .info-->
 <div></div>
</li>
<?php endwhile;
}

This is very easy code to fetch you wordpress popular posts. Here I am fetching only 5 popular posts from wordpress. You can fetch the multiple popular posts by changing the $post variable value.

In wordpress theme sidebar or footer section if you want to show the popular post then just use following code.

popular_posts_by_comments();

most popular posts wordpress without plugin
most popular posts wordpress without plugin

where you want to show the popular posts.

show popular posts without wordpress plugin in theme
show popular posts without wordpress plugin in theme

Remove Unwanted Meta Boxes from wordpress dashboard through wordpress theme

When we login to wordpress admin area that time we first saw the admin dashboard. Many tabs and section are not useful in admin dashboard section for wordpress admin and sometimes we don’t know what is that sections.

Remove Unwanted Meta Boxes from wordpress dashboard through wordpress theme

We saw the right now, recent comments, quick press, stat, recent drafts, incoming links, wordpress development blog, other wordpress news, plugins and more sections in wordpress dashboard section. Most of that section are not useful to wordpress admin. So is that better to remove unwanted section from dashboard.

Remove Unwanted Meta Boxes from wordpress dashboard through wordpress theme
Remove Unwanted Meta Boxes from wordpress dashboard through wordpress theme

For disable the dashboard section we are going to use the wp_dashboard_setup method. In wordpress dashboard there are multiple meta boxes listed. some of them as follows:

//Main column
$wp_meta_boxes['dashboard']['normal']['core']['dashboard_right_now']
$wp_meta_boxes['dashboard']['normal']['core']['dashboard_recent_comments']
$wp_meta_boxes['dashboard']['normal']['core']['dashboard_incoming_links']
$wp_meta_boxes['dashboard']['normal']['core']['dashboard_plugins']

//Side Column
$wp_meta_boxes['dashboard']['side']['core']['dashboard_quick_press']
$wp_meta_boxes['dashboard']['side']['core']['dashboard_recent_drafts']
$wp_meta_boxes['dashboard']['side']['core']['dashboard_primary']
$wp_meta_boxes['dashboard']['side']['core']['dashboard_secondary']

For removing the widgets or meta boxes from dashboard you need to open your functions.php file from wordpress theme folder and put following code in that file.

function remove_dashboard_meta_boxes(){
  global$wp_meta_boxes;
  unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_plugins']);
  unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_recent_comments']);
  unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_primary']);
  unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_incoming_links']);
  unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_right_now']);
  unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_secondary']);
}

add_action('wp_dashboard_setup', 'remove_dashboard_meta_boxes')

This code will remove the incoming link, right now, plugins, recent comments and secondary section from wordpress dashboard section.

Remove Unwanted Meta Boxes from wordpress dashboard through wordpress theme
Remove Unwanted Meta Boxes from wordpress dashboard through wordpress theme

If you want the more information about wordpress dashboard widget then check following URL
http://codex.wordpress.org/Dashboard_Widgets_API

If you are having any issue or questions about wordpress dashboard then please write to me.

how to prevent direct access to images through server

how to prevent direct access to images. To protect your images or media file you should use apache rewrite rules. To protect being linked on another website. To protect your images or media file you should use apache rewrite rules. To protect your images or other files from being linked or used on another website. Due the this issue your images may be used by many sites.

how to prevent direct access to images

how to prevent direct access to images
how to prevent direct access to images

The Apache Server’s Mod Rewrite Engine can examine the name of the document requesting a file of a particular type. If the URL of the page requesting the image file is from an allowed domain, display the image. Otherwise, return a broken image.

There are many people who try to use your website images. That will cut your bandwidth so using this code is good idea.

You can use following apache code in apche config file or put following code in your .htaccess file.

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://images.purabtech.in/.*$     [NC]
RewriteCond %{HTTP_REFERER} !^http://www.purabtech.in/files/.*$ [NC]
RewriteRule .*\.jpg$
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://images.purabtech.in/.*$     [NC]
RewriteCond %{HTTP_REFERER} !^http://www.purabtech.in/files/.*$ [NC]
RewriteRule .*\.jpeg$
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://images.purabtech.in/.*$     [NC]
RewriteCond %{HTTP_REFERER} !^http://www.purabtech.in/files/.*$ [NC]
RewriteRule .*\.png$
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://images.purabtech.in/.*$     [NC]
RewriteCond %{HTTP_REFERER} !^http://www.purabtech.in/files/.*$ [NC]
RewriteRule .*\.gif$
RewriteRule .*\.(jpg|jpeg|gif|png|bmp)$ - [F,NC]

Second thing you should do. you should create the dummy index.html file and put in your images folder for so any visitor will not see the directory listing of images.

If you use above code then when other domain try to see or use the your images then they will see the following error message.

it will result in a Forbidden error.
Still if you are having any issue or question then write to me.

Create multiple widgets in wordpress theme

WordPress tutorial for, In this article we will show, how to Create multiple widgets in wordpress theme. Widgets for very important in wordpress themes and plugins. First I need to tell you this widget api is located in following file.

wp-includes/widgets.php

For enable the sidebar support in wordpress theme you need to register atleast one sidebar in wordpress api. For enabling the side bar you need to just open the functions.php file and put following code in that file.

if ( function_exists('register_sidebar') )
register_sidebar();

This is enable the global sidebar for your wordpress theme.

If you want multiple sidebar in your wordpress theme then use the following code. I created two sidebars in my wordpress theme. First is normal sidebar and second is footer sidebar.

For main sidebar showing just open your sidebar.php file put following code in that file.


if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Main Sidebar') ) :
 endif;

For showing second widget in footer section open your footer.php file and put following code in that file.


if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Footer Sidebar') ) :
 endif;

Then go to your widget section through admin panel and select your widget which you want to show in widget sections.

Create multiple widgets in wordpress theme
Create multiple widgets in wordpress theme

If you are having any issues or question about using widget in wordpress theme then write to me.

how to use shortcodes in wordpress posts

Short code api is introduced in wordpress from 2.5 version. Since short code is very popular and used by wordpress plugin developers. Many wordpress theme and plugin developers do use the shortcode api regularly.

how to use shortcodes in wordpress posts

how to use shortcodes in wordpress posts
how to use shortcodes in wordpress posts

Using shortcode api is very easy. If you want to use the shortcode in your wordpress theme then open your functions.php file and put following code. Here is example for using shortcode.


function wordpressapi_content() {

echo "Hello World";

}

add_shortcode('wordpressapi_content', 'wordpressapi_content');

Create any page and just put following line in that post or page.

[wordpressapi_content]

If you put following code in your page or post then you can see the hello world content in your page or post.

If you want to add the google adsence using shortoce then use the following code.


function google_adsence($atts) {
 return ' "<script type="quot;text/javascript"quot;">"<!--
google_ad_client = "quot;ca-pub-4949877136251097"quot;;
/* 160x600, created 4/7/08 */
google_ad_slot = "quot;5503695728"quot;;
google_ad_width = 160;
google_ad_height = 600;
//--">
"</script">
"<script type="quot;text/javascript"quot;
src="quot;http://pagead2.googlesyndication.com/pagead/show_ads.js"quot;">
"</script">
'
}

add_shortcode('google_adsence', 'google_adsence');

Then just put the following words in your post or page or widget section.

[google_adsence]

Your adsence will be displayed. For advanced information about shortcode you should check following URL

http://svn.automattic.com/wordpress-tests/wp-testcase/test_shortcode.php

If you are having any issues or question about shortcode then please write to me.

pune to ganpatipule route by car distance 330 km

Last month I went to Ganpatipule from Pune. I visited Ganpatipule for 3 to 4 times and I went to ganpatipule from many routes. In this article I will tell you which is best road route for going to Ganpatipule.

pune to ganpatipule route by car distance 330 km

Important : Dont take mulshi and Mahad route. Actually when you search in google maps you first got that route. But roads are not good on that route and that is not very nice route.

Kubharli Ghat pune to ganpatipule route by car distance 330 km
Kubharli Ghat pune to ganpatipule route by car distance 330 km

Take NH4 Highway route. First go to Satara -> Umbraj. From Umbraj take right turn to patan gaon. Patan-malharpeth then go to Helwak -> Kumbharli Ghat – then go to Chiplun. From Chiplun If you want to go by short cut then go from Dangli Akhli road. You need to ask there How to reach Ganpatipule from Dangli Akhli road.

Dont go to Hathkambha take dangli akhali road that will save you 35 to 40 kilometers road.

Pune-Satara-Umraj-right turn- patan-Malharpeth-Helwak-Kumbharli Ghat-Dangli Akhali -Ganpatipule

Total KM – 300 KM.

Nice places between Road. You must see the konanagar Dam and For seeing the dam you need to take pass from the Dam office. You should see the Nehru Garden. This garden is very nice and clean and big. From this garden you can see the dam. Between the road you will see the many monkey in Kumbharli Ghat but dont stop the car and dont feed the money because that monkeys are not good. Between Kumbharli Ghat you will see the many waterfalls.

Ganpatipule Beach
Ganpatipule Beach

Stay at Ganpatipule- You will get very nice rooms at ganpatipule for rated only 600 to 800. That will enough for one family or 6 to 8 people. With four bedroom and attached bathroom.

Food is also very cheap and nice. For 40 to 50 rupees you will get the thali.

Ratnagiri Beaches –

AreWare beach – 13 Km from Ganpatipule, Nice clean, lonely and safe beach

Ratnagiri Light House – 26 Km from Ganpatipule, You should see this.

Bhatya Beach – 26 km from Ganpatipule, Nice place but not nice beach

Madvi Beach – 32 km from Ganpatipule, Nice , lonely but not safe beach

Ratnagiri is cheap and nice and clean city.

Google adsense MFA website list for bloggers

There are many webmaster and blogger who want to make money through online ads. Many people use the google adsence for making online money. Google adsence pay on your cost per click (CPC). Many times your user click on ads but still you dont get good amount of revenue. Because click-through-rate or CTR of your ads which displays on your website is very low. Most of the clicks are worth as low as $0.01 per click.

Google adsense MFA website list for bloggers

Some people may be heard about what is MFA (Made for Adsence).  MFA sites owners make lowest bid for adsence. So when that ads displays on your site and user clicks on that ads then you got minimum revenue. you need to block those site through google adsence.

I created the list of websites you need to blog from your google adsence. Here is list of websites you need to block.

10-bestsites.com
10-top-sites.com
101soho.com
110mb.com
12-bestsites.com
1click.com
1details.info
1helpon.info
1homeshopping.info
1s.md
1st-clothings.com
1st-day.info
1st-free-articles.com
1st-home-business.net
1st-lingerie.net
1st-portal.net
1st-swimsuit.com
1step1.info
2009chevroletcamaro.com
2020ok.com
207.97.233.242
25-topsites.com
5-top-sites.com
5toppers.com
68.178.218.75
6bestsites.com
7-topsites.com
8-topsites.com
8-topwebsites.com
8bestsites.com
8topsites.com
8topsitespro.com
9topsites.com
accessoryinfo.com
acne.com
actionad.com
advancedwebsearch.info
afwtech.com
alatest.com
all-free-info.com
allinformationabout.com
allsportinggoods.net
alltheautomotive.com
alltheindustrials.com
amazon.co.uk
amazon.com
answerstoday.com
aprido.com
aptmicro.com
aquariumbackground.info
aquariumfilterdirectory.com
aquariumplants.info
aquariumrocks.info
aquariumsfish.info
aquatic-plants.info
articlescafe.com
authentictraders.net
auto4every1.net
automercado.com
bateriafina.com
best-healthcare.info
best3websites.com
best4sites.net
best4solutions.com
best5online.com
best7sites.com
best8-sites.com
best8sites.com
best8sites.org
bestautosites.net
bestcomputingsites.com
bestcraftsites.net
besthomegardensites.com
besthomegardensites.net
bestinsurance.cc
bestpictures.org
bestresultz.com
bestringtonesoffer.com
bestsportingsites.com
bestwebdiscounts.com
bestwebpix.com
bestwebpix.net
blogspot.com
bluediamonddirectory.com
business-wiz.com
buymp3music.info
byboh.com
carpictures.com
chargerforums.com
chasingstuff.com
chiller1.net
chillerdirectory.info
chosenresult.com
ciao.de
ciao.es
clcsoftware.net
click-4-info.net
clickbank.net
clickheretogetmore.info
commerce-database.com
compare-to-choose.com
comparisonwarehouse.com
compendianet.com
conceptcar.co.uk
coolringtones.com
cv2006.biz
dbmoz.biz
dbmoz.com
dbmoz.net
dbmoz.org
dealsandoffers4u.com
decorationdirectory.info
dfc.co.za
digg4it.com
dirkw.com
discoveree.net
discoverees.net
discussit.biz
diseasedirectory.info
dodgechallenger247.com
download-hub.com
downloadrings.com
downtown-internet.com
drift-kings.com
drumsbarrelscontainers.com
dry-skin-care-guide.com
e-isn.com
e-nternet.com
eanimationschools.com
eantispyware.info
eaquariumfilter.info
easycardirectory.com
ebay.co.uk
ebay.com
ebay.com.au
ebay.de
ecomputerwallpaper.com
edigitalphoto.info
edigitalphotoalbum.com
edmunds.com
education-place.info
educational-online.com
ekaiweb.com
emotivationalvideos.com
ephotoalbum.net
eretirementjokes.com
eroyaltyfreeimages.net
everyclick.com
everyrule.com
ewossnewsbar.com
exactinformation.com
expert-expert.com
extreme-rides.com
ez4search.com
factguide.org
fant.4t.com
faqsdirect.com
fastcoolrides.com
faster-results.com
fasterinfo.com
faxingsoftware.info
figureeights.info
filtersspam.info
findexia.com
findfishpicture.info
findinfotoday.com
finditonline.ws
findmonk.com
findtop4.com
finest4.com
fishcatalog.net
fishdiscus.info
fishfooddirectory.com
fishinglistings.com
fishmealmachine.com
fishpicture.info
fishtankdirectory.com
free2select.com
freecyberzone.com
freedigg.com
freekv.net/rising
freeusefulinfo.com
freshwater-fish.info
gathersdata.com
gd-invest.com
gdn-invest.com
gdn-loan.com
geo-trotter.net
get-free-reports-tips-and.info
getinfoon.info
globalinfoexchange.com
go-2-shop.co.uk
gododgecars.com
goldfish-care-tips.com
gomeo.de
goodplace-on.net
gooyeep.com
gr8info.net
greatinfo.biz
greytones.net
gubaara.com
guide2biz.com
guideya.com
haohao99.com
has7.com
hellowebsite.cn
hi5.com
home-n-garden.net
homeandgardenhelp.net
hoodscatalog.com
hot4sites.com
idesktopwallpaper.net
imedicalanimation.com
in-atlanta.net
industryonly.net
info-on.biz
info-tree.com
info.com
info4-entertainment.com
info4-food.com
info4entertainment.net
info4garden.com
info4garden.net
info4today.info
infobeagle.com
infoforyourhealth.com
informationvistas.com
infoscouts.com
infosearch4u.com
infowikis.com
inhunt.com
instantresource.net
internet-downloads.net
ivue.com
jumblez.net
kijiji.ca
koi.es
kwikreply.com
kzxpz.org
lauda.de
lenntech.com
lexus.ca
lightingaquarium.info
links-4-you.com
linx-best.com
linxbest.com
lirated.com
lmkengineering.co.uk
local.com
makegreatpets.com
meanwhile.com
mediataskmaster.com
medicalhelpers.com
medkuz.com
megasearch.biz
megasearching.info
mozsite.com
mustinfo.net
myflashfetish.com
mylot.info
myluxuryyacht.com
myluxuryyachtcharter.com
mymoneymaker.org
mywebgold.com
netfish.net
niche-dir.com
nishikigoi-info.com
nosy-searcher.com
nytimes.com
oceleb.com
official-auto.net
oneinvestment.co.uk
oninformation.com
onpointsmarts.com
otelevision.info
petchoice.net
petinfos.com
picturesfish.info
picturetoplist.com
pimpmyride.com
pimpmyridetoday.com
popularq.com
pricegrabber.com
purebusiness.com
puredirectory.com
purityplanet.com
quotematch.com
rainbow-fish.info
rapvideos.info
ratedsolutions.com
realestate-spot.net
resourcemecca.com
reviewcars.com
reviewsbykrystal.com
richesse-succes-sante.com
ringringmobile.com
ringtonemusic.info
rockscatalog.com
romingerlegal.com
rsportscars.com
ru2006.com
rw2006.com
saltwaterfishdirectory.com
saltwaterfreshwateraquarium.com
savvygate.com
scholarshipnet.info
searchbriar.com
searchemu.com
searchemu.org
searchguide.biz
searchignite.com
searchinfo100.com
searchizoid.com
searchscribe.com
searchtonga.com
searchtorpedo.com
searchwisp.com
searchzonk.com
seek4me.org
sharkdirectory.info
shopping.com
simplemoneymachines.com
sing365.com
sitetrackers.net
smartcar101.com
smarter.com
snap2007.com
soobot.com
sport-universe.net
sportinggoodsonly.com
sports4us.com
sportscarssearch.com
sunnypages.jp
super-results.com
supersitesearch.net
sureresult.com
suvvehicles.info
tankcleaningdirectory.com
teachandtravel.net
testandtune.com
theacrylicsite.com
thebabydepartment.com
thefiltersite.com
thesearchpad.com
thextremehosting.com
thinktarget.com
tipace.com
tools4myspace.com
top-10sites.com
top-3-sites.com
top-articles-house.com
top10websites.net
top4search.com
top4search.net
top4sites.net
top8sites.com
topbeautysites.com
topbestsites.org
topdozensites.com
toptensites.biz
toptensites.org
toptensites.us
toseeka.com
tradingpost.com.au
transportationinfo.com
tropical-fish-lovers.com
tropicalfish.smmsite.com
tropicalfishdirectory.com
tropicalsfish.info
tunu.com
u-i-x.com
usedlotus.net
usefulfaqs.com
usnom.com
videoriders.com
videosstreaming.info
watertankreviews.com
watertreatmentguide.net
webagt.com
webfinder360.com
webresultz.net
webrezult.com
website-savvy.com
webzsearch.com
wesearchitforyou.com
wikimapia.org
wilddreams.org
windingroad.com
winningsites.net
world-click.com
www-aquariums.net
www-transportationinfo.com
xdope.com
xlnse.com
xtraone.co.uk
xtrasearch.net
yahoo.com
zebrasdirectory.info
zimply.com

If you have any doubts of issues then write to me.

How to delete drupal cache manually through mysql

Some time I found some issues with Drupal site. When we make changes in javascript or in PHP code we need to clear the cache from Drupal site. One time I got really weird issue. I am not able to access my druapl admin also.

delete drupal cache manually through mysql

Then I found only one option which is I need to clear the cache from Drupal. Using Drupal admin panel we can easily delete the drupal cache but how can I delete the drupal cache manually. We can delete the Drupal cache through mysql also.

 

For that you need to use following mysql commands in phpmyadmin or through mysql command line.

[viral-lock message=”Solution code is Hidden! It’s Visible for Users who Liked/Shared This article on Facebook or Twitter or Google+. Like or Tweet this article to reveal the content.”]

[mysql]

DELETE FROM cache;

DELETE FROM cache_filters;

DELETE FROM cache_menu;

DELETE FROM cache_page;

DELETE FROM watchdog;

[/mysql]

[/viral-lock]

above mysql commands will clear all the cache from drupal. If you want more drupal tutorials than visit here

What is reset css and How to use the reset CSS

Many new web developers or web application developers may be did not hear about reset CSS. Many web developers use the global selectors and global CSS styling. That is very basic reason behind that. They want to display their CSS style across the various browsers.

What is reset css and How to use the reset CSS

The goal of a reset stylesheet is to reduce browser inconsistencies in things like default line heights, margins and font sizes of headings, and so on. With reset CSS you are overriding the setting of various browser setting and elements. There are inconsistencies with every browser. For reducing the issues and setting of browser you need to reset the browser properties.

What is reset css and How to use the reset CSS
What is reset css and How to use the reset CSS

With reset CSS you can set the border, font color, color, margin, padding, img, h1, a, etc properties. The problem is that every browser’s stylesheet has subtle but fundamental differences. By using a CSS reset. There are many big sites and tool available for using the reset the CSS.

In reset CSS you need to use the most common HTML tags and their properties for reset there CSS properties.

you can also create you reset CSS as per your website need. There are many useful and good reset available. I like the YUI reset CSS most because that is really useful.

For using the YUI reset CSS you need to just add the following line in your website.

<!-- Source File -->
css" href="http://yui.yahooapis.com/3.2.0/build/cssreset/reset-min.css">

For more information about YUI reset css you can visit the following URL
http://developer.yahoo.com/yui/3/cssreset/

Following reset css is most common in each and every website and following code is useful for every website.

html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, font, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td {
	margin: 0;
	padding: 0;
	border: 0;
	outline: 0;
	font-size: 100%;
	vertical-align: baseline;
	background: transparent;
}

Reset CSS is really useful for every website. do use the reset CSS in you stylesheet. There is another good reset CSS called blueprint which you download from following URL.
http://code.google.com/p/blueprintcss/.


Some people are saying dont use the reset css because that will increase the your css size but I must admin this thing.
you should use the reset css that will save your big time.

What is reset css and How to use the reset CSS
What is reset css and How to use the reset CSS