Home WordPress Tips WordPress Tips Part 1

WordPress Tips Part 1



Updated on


This post is guest blogged by Milo of 3OneSeven.com. For all codes, type them out. Do not copy and paste.

Tip #1

DO NOT use this search code in the



<?php echo $_SERVER ['PHP_SELF']; ?>

Nobody should be allowed to search your entire server, or?

Use this one instead:

<?php bloginfo (‘home’); ?>

Tip #2

Another bad code used in title tags or search templates:

<?php echo $s; ?>

as it allows malicious code injection.

Use this one:

<?php echo wp_specialchars($s, 1); ?>

Tip #3

  • DO NOT use the default Kubrick theme, as it contains a security bug. Affected Script:

    “Header Image and Color” section of the Default Theme Kubrick.

  • Further info here.
  • Also, some themes are based on the Kubrick header functions, examine those themes carefully as they can have the same vulnerability.

Before doing any of the following customization, BACK UP your existing files. Or better, test it on your local or server test site.

Tip #4: Style Switcher The Easy Way

  1. Download this Javascript file *(Not Available)
  2. Upload the style switcher file to your theme’s “js” folder
  3. Copy your basic theme stylesheet and rename it to style2
  4. Insert the Javascript in your header:
    <script src=”<?php bloginfo(‘template_directory’); ?>/js/ style-switch.js” type=”text/javascript”></script>
  5. Insert the two stylesheets in your header:
    <link rel=”stylesheet” href=”<?php bloginfo(‘stylesheet_url’); ?>” type=”text/css” title=”default” media=”screen” />
    <link rel=”alternate stylesheet” type=”text/css” media=”screen” title=”style2″ href=”<?php bloginfo(‘template_directory’); ?>/style2.css” />

    Note the difference between the title “default” for your basic stylesheet and the second title “style2″. Vary your basic stylesheet by applying new rules to the id’s and classes.

  6. Upload new images to your themes image folder (if needed)
  7. Insert the script call at an appropriate place:

    <a rel=”no follow” title=”Toggle stylesheets” href=”javascript : chooseStyle(‘none’, % 20 60)”>#000</a>


    <a rel=”no follow” title=”Toggle stylesheets” href=”javascript : chooseStyle(‘style2′, % 20 60)”>#fff</a>

    Bullet proof for IE6+7.

Tips #5

Block search robots from your archive page by preventing the indexing:

<?php if(is_archive()) { ?><meta name=”robots” content=”noindex”><?php } ?>

Paste it anywhere in the header of your current theme BEFORE the closing of the head tag.

From Small Potato

Part 2 of Milo’s tips will show you how to add Gravatar, add a side blog, customize the read more link, customize the comment link, and customize the WordPress login.


Please enter your comment!
Please enter your name here

Recent posts

HostPapa Linux Hosting: Reliable, robust and fast

As a small business owner, it can be challenging to find the right hosting provider for your website. HostPapa distinguishes itself from other web...

Are You Making These Costly Mistakes When Outsourcing?

In today’s world, it is almost impossible to find a small business where everything about the business process is done in-house. For most small...

Flat Design for Your WordPress Site: What Is It + 4 WordPress Flat Design Themes

Web designers in the past mostly used 3D styles for buttons that made the button seem more realistic. That all changed when flat design...

LawBlog WP Theme Review

Regardless of which area of law you practice, it’s imperative that you have proper online representation. You need to give your customers a feeling...

The Deeper Meaning and Purpose Behind Shapes in Web & Graphic Design

Sometimes in web design, a clean website is often the best choice for certain clients. Instead of elaborate backgrounds or too many aesthetic choices,...

Recent comments