wordpress tips

WordPress Tips and Trick

This guest post was written by Hayes Potter, the 13 year old web developer and designer that gives webmasters tips on protecting their website from common hacking techniques. If you have webmaster or WordPress knowledge and are interested in writing a post for Hack WordPress, please contact us.

Adding A Side Blog

1. Pick a desired category and add it in your blog (i.e. category “Side Blog”)
2. Implement the following code into your “Functions.php” in your theme’s directory:

function asidesFilter($query) {
if($query->is_feed || $query->is_home || $query->is_ search) {
$query->set(’cat’, ‘-115?);
}return $query;}
>add_filter(’pre_get_posts’, ‘asidesFilter’);>
?>
(Notice the number 115 is the category ID number for the chosen category. Yours will be different.)

3. Then add the following into your “sidebar.php” file in your theme’s directory:
<h3>Side Blog
<a title=””My” href=””FEED”>
<img style=””position:” src=””RSS” alt=””RSS”” />
</a></h3>
<h3><a title=””My” href=””FEED”>
<img style=””position:” src=””RSS” alt=””RSS”” /></a><a title=””My” href=””FEED”>
</a></h3>
<span class=””aside_archive_link””>
<a title=””More” href=””CATEGORY”>Archives</a>
</span>
Enhancing Your “Read More” Link

1. Open your “index.php” or file and find this line:

2. replace it with this one:

Enhancing Your “Comments” Link

1. Open your index.php, archive.php, and single.php and find this line:

2. Replace it with this one:
__(’One comment on ‘ . the_title(”,”,false)), __(’% comments on ‘. the_title(”,”,false))); ?>

Random Tip #1

Do NOT use the following search code in the
“search.php” file in your theme’s directory :

Nobody should be allowed to search your entire server right?

Use this instead:
Random Tip #2

Yet another bad code used in title tags or search templates:

as it allows some harmful Sql injections =(.

Use this instead:

Random Tip #3

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

Paste it anywhere in the “Header.php” file of your current theme’s directory in the tags.

About the Author

admin

Leave a Reply