7 Very Simple Tips and Tricks for getting More out of WordPress

moreWordpress

WordPress is a very powerful blogging and CMS tool but as with all content management systems it needs tweaking to meet certain needs. Here are seven things you can do to get more out of WordPress with very little effort.1. Use Page Templates for custom Page Layouts

In the root of your theme folder in your WordPress install is a file called page-custom.php. Duplicate this and name it something relevant then change template name. Although this has been commented out, WordPress uses this as the name of the of the template which you will select later.

<?php
/*
Template Name: About
*/
?>
<?php get_header(); ?>
<?php get_footer(); ?>

Now place whatever code you want in between the header and footer tags. When editing a page you can now choose that page template to be used on that page.

Select a page template

Select a page template

2. Customise the Login Page

Simply locate the login.css file in the CSS folder in wp-admin and make any changes you see fit. For example replace the WordPress logo with one of your own by editing the following code:

h1 a {
	background: url(../images/logo-login.gif) no-repeat top center;
	width: 326px;
	height: 67px;
	text-indent: -9999px;
	overflow: hidden;
	padding-bottom: 15px;
	display: block;
}

Make sure you keep a backup of any changes you make as they’ll be overwritten when you upgrade.

3. Style Author Comments

Styling author comments is extremely easy as it has been a feature since version 2.7. Simply target the list item with a class of bypostauthor with the following code in your CSS:

li.bypostauthor { color: blue; }

4. Separate Comments and Trackbacks

By default, WordPress display trackbacks in amongst comments. It looks messy and makes it hard for readers to follow the conversation.

Find this line in your comments.php file:

<?php foreach ($comments as $comment) : ?>

Place this code directly underneath:

<?php $comment_type = get_comment_type(); ?>
<?php if($comment_type == 'comment') { ?>

Now find the following line:

<?php endforeach; /* end for each comment */ ?>

Insert the following line directly above it:

<?php } else { $trackback = true; } /* End of is_comment statement */ ?>

This will display the comments all on their own. To display the trackbacks in their own section, locate this code:

<?php else : // this is displayed if there are no comments so far ?>

Paste the following above:

<?php if ($trackback == true) { ?>
<h3>Trackbacks</h3>
<ol>
<?php foreach ($comments as $comment) : ?>
<?php $comment_type = get_comment_type(); ?>
<?php if($comment_type != 'comment') { ?>
<li><?php comment_author_link() ?></li>
<?php } ?>
<?php endforeach; ?>
</ol>
<?php } ?>

Now the trackbacks will appear below the comments in the form of an unordered list.

Source:

http://www.problogdesign.com/how-to/separating-trackbacks-from-comments/

5. Implement Pagination

WordPress only includes links between the next and previous pages when displaying a list of posts such as on the home page. Download the WP-PageNavi plugin to add full pagination support.

pagenavi

The WP-PageNavi plugin is highly customisable.

6. Hide the Excerpt if left Blank

By default, if you have your theme set to display the excerpt and nothing is entered, WordPress will just display the full text instead. If you want don’t want anything displayed then simply place the following code wherever you want the excerpt to appear (or not)

<?php if(!empty($post->post_excerpt)) {the_excerpt(); } ?>

Source: Paul Boag on Twitter

7. Easier to Read, Meaningful URLs

Head into the permalink settings in the settings section of your WordPress admin area and change it from anything except Default and Month and name. The image below shows how Inspect Element has it setup showing the category first followed by the post title such as:

http://inspectelement.com/tutorials/animate-a-contact-us-slide-out-area-using-jquery/

permalink

Changing the permalink settings will ensure better URLs.

Not only will the make it easier to read for the user, it also makes it easier to understand for search engines to pick up resulting in better SEO. Make sure you change it!

Discuss this on Google+

by @tkenny

You should follow me on Twitter here

Subscribe to Inspect Element by email to get updates on new articles, tutorials and WordPress themes: