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

The importance of SSL Certificates as part of a web hosting package

Building a successful business requires trust, and gaining trust can be difficult especially when you run a business where it is taken for granted...

How Can Domain Name Extensions Influence Your Brand Name?

Are domain name extensions important in naming your brand? The shortest answer is "Yes." In today's online world, it is the first thing that...

Domain Name Generation Tips for Business in the Teen Niche

Choosing a domain name is important for every business; how much more when you want to choose a name for a niche site like...

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

Recent comments