Best Practices for Creating Unique Blog Posts

Recently here on [wp] I’ve been sharing little tips that will help create a unique look for individual blog posts. Today we’ll be rounding up the “best practices” for creating that unique look, the easy way.

Post templates

Getting rid of the sidebar is a simple way to expand your options. Were we using pages, it would be easy to get rid of the sidebar with a page template, but those don’t exist for posts, do they? Wrong. They do. You just need a plugin which gives you page-like options for choosing your post template:

<?php
/*
Single Post Template: Template Name
Description: This part is optional, but helpful for describing the Post Template
*/
?>

And then with some simple styling you can widen your content area and get rid of the sidebar, offering you more room to create an awesome post.

Multiple sidebars

Say you don’t want to get rid of the sidebar, but instead display a different sidebar. That’s easy if you do multiple sidebars the right way, which, of course, has the following syntax:

  • Save new sidebars with the sidebar-name.php format.
  • Use <?php get_sidebar(); ?> to display new sidebars: <?php get_sidebar('name'); ?>

You can then create a page template with your different combinations of sidebar and make that blog post just that bit more unique.

Unique titles

Image replacement, emphasis, bold, the lot are all possible thanks to custom fields. Expanding further on this post, unique titles with image replacement are really easy to do. You just need to create a custom field called “post-title” and then you can put into that any kind of HTML you like – perhaps an image or just some emphasis? It’s all easy to do; you’ll need to replace <?php the_title(); ?> with the following code which will search for a custom field, display it if it exists and then fall back on the title.

<?php
$postitle = get_post_custom_values("post-title");
if ( is_array($postitle) ) { ?>
<?php echo get_post_meta($post->ID, "post-title", true); ?>
<?php }	else { ?>
<?php the_title(); ?>
<?php } ?>

Remember that custom fields can hold any kind of information and so you can put whatever you like in them to be displayed as the title – an image, some emphasis or just some text; do whatever you like.

Inline styling

Custom fields to the rescue again; we can use custom fields to add some simple styling to any post. As we’re outside of the loop, we’ll need some extra code, but nothing too complicated:

<?php $css = get_post_meta($post->ID, ‘css’, true); ?>

Needs to go at the top of your header file and then below your stylesheet, you’ll need the following:

<?php echo $css; ?>

And then you can fill in your custom field with some inline styling and perhaps change the background:

<style type="text/css" media="screen">

body{ background: #fff; }

</style>

Create columns of text within the post

This is probably my favourite. Using a simple grid system, it’s possible to put your content into many columns. This post explains all. You may ask why you don’t just use a <p class=”grid1″>-like system. The answer is that WordPress automatically adds in the <p> tag, so the only real option is to use <div>s.

Concluding

So there we have a number of ways to create a really fantastic unique blog post. Go and reap the rewards!


4 Comments
Most Voted
Newest Oldest
Inline Feedbacks
View all comments
Gary Cloud
August 7, 2012 7:52 pm

Great advice, especially after the recent Google updates which means it very important for unique content on the internet.

Ant Gray
June 6, 2010 9:52 pm

I suggest to link another css file than using style tag. Easier to maintain, and it caches.

23 articles and resources to improve your Wordpress life! | JortK.nl
February 1, 2010 3:29 pm

[…] Best Practices for Creating Unique Blog Posts Some golden rules you should follow when creating blog […]

Il meglio della settimana #47 | BigThink
January 30, 2010 1:33 pm

[…] Best practices for creating unique blog posts Alcuni trucchi per la personalizzazione dei post. […]