Home WordPress Tips WordPress Tips Part 1

WordPress Tips Part 1

Author

Date

Updated on

Category

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

search.php

:

<?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:
    /themes.php?page=functions.php

    “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:
    Styles:

    <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.

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Recent posts

5 WordPress Plugins to Increase Your Website Speed

 And if you’re an online entrepreneur, you probably know that making people wait is bad for your eCommerce business too — really bad.I mean,...

How to Show Only Images that the User Has Uploaded in WordPress

When using WordPress with multiple authors, many things need to be taken into consideration. The default permissions system leaves much to be desired, and...

Oxygen Builder Review

Free from all sorts of coding hassles and an abundance of options that cater to the users’ needs, Oxygen 2.0 is probably the best...

Basic Guide to Online Backup

A Basic Guide to Online Backup You may have heard of it, know you need it, but what exactly is it? Online backup is the...

Web Hosting Hub Review

How did it begin? Based in Virginia Beach, Web hosting hub has been on the market since 2001. If it were not for Web Hosting...

Recent comments