Advertisement
Tips

Quick Tip: After the Content - Post Meta

by

Human or crawler, a visitor needs to find where your post belongs. Even if you have category or tag archives, it's almost always a necessity to include a section to display a little bit information for the content.

In this post, we're moving on with our series with the "post meta", the identity card of the post.


"Post Meta" to Help People (And Crawlers) Find Their Way

While a "related posts" section is the most effective way to offer people relevant content, it's also good practice to serve the information of the post's categories, tags, publishing date and so forth - both for humans and search engine spiders.

Why Use a "Post Meta" Section?

I don't know if you have ever done this, or have seen someone else do it, but sometimes people like to consume the content of a website as a whole.

You might have come across some weird data in your website's statistics, which showed that one visitor (or a couple of visitors) spent over 3 hours on the website. If you have good content, the chances are higher to see weird data like this in your website's stats.

This kind of content consumer is the kind who will constantly share your posts and talk about your website. You must care about these people the most and in order to help them spend hours in your website, you must provide them with a well structured post meta section.

The same goes for "normal" visitors: They might be interested in other posts from the same category or author, or they might want to know when the post was published. Also, of course, search engines always need information to categorize and structure your website's page listings.

Creating a Strong "Post Meta" Section

In order to serve a "post meta" section with good quality, we must think of what it should consist of. Off the top of my head, I can list a couple of items:

  • The author of the post (with a link)
  • The categories that the post is in
  • The tags the post has
  • The publish date of the post
  • A link to edit the post (for admins and authors, of course)
Naturally, WordPress provides core functions for these elements: the_author_link(), the_category(), the_tags(), the_date() and edit_post_link().

This is not a section that requires attention, so there's no need to shine through - three lines is enough for the post meta, I think. So, if we put them together, we can build something like this:

<div class="post-meta">
	<div class="author-date">This post was written by <?php the_author_link(); ?> on <?php the_date(); ?>.</div>
	<div class="categories">Categories: <?php the_category(); ?></div>
	<div class="tags">Tags: <?php the_tags(); ?></div>
</div>

Done! Simple and effective.


Conclusion

Yes, content may be "king" but a lonely king is a weak king, and people might not respect that "king".

We now know the essentials of the "post meta" section - why use it and how to use it effectively. If you have anything to say, please share your comments with us!

Related Posts
  • Code
    Theme Development
    Creating a WordPress Theme from Static HTML: Creating an Archive TemplateCreating wordpress theme from html 400
    If you've been working your way through this series, you now have a functioning theme with two page templates. The steps I've demonstrated to this point are: preparing your markup for WordPress converting your HTML to PHP and splitting your file into template files editing the stylesheet and uploading your theme to WordPress adding a loop to your index file adding meta tags, the wp_head hook and the site title and description to your header file adding a navigation menu adding widget areas to the header and sidebar adding widget areas, a colophon and the wp_footer hook to the footer file creating template files for static pages. Read More…
  • Code
    Theme Development
    Creating a WordPress Theme from Static HTML - Creating a Page TemplateCreating wordpress theme from html 400
    So far in this series, I've shown you how to create a fully functioning WordPress theme from static HTML. We've covered the following steps: preparing your markup for WordPress converting your HTML to PHP and splitting your file into template files editing the stylesheet and uploading your theme to WordPress adding a loop to your index file adding meta tags, the wp_head hook and the site title and description to your header file adding a navigation menu adding widget areas to the header and sidebar adding widget areas, a colophon and the wp_footer hook to the footer file. At the moment, your theme only has one template file for displaying content—the index.php file. A powerful feature of WordPress is the ability to use template files for different kinds of content.Read More…
  • Code
    Theme Development
    Creating a WordPress Theme From Static HTML: Adding a LoopCreating wordpress theme from html 400
    In the first three parts of this series, you learned how to prepare static HTML for WordPress and to create a theme by splitting your HTML file into a set of template files and editing the stylesheet. You then uploaded your theme to WordPress and activated it. The theme still isn't displaying any content you add via the WordPress admin however; to do that you need to add a loop to your template files.Read More…
  • Code
    Theme Development
    Creating a WordPress Theme From Static HTML: Creating Template FilesCreating wordpress theme from html 400
    In the first part of this series, I showed you how to prepare your HTML and CSS files for WordPress, ensuring the structure would work, the code was valid and that the correct classes were being used. In this tutorial you'll learn how to take your index.html file and split it up into a set of template files for use by WordPress.Read More…
  • Code
    Theme Development
    Creating a WordPress Theme From Static HTML: Preparing the MarkupCreating wordpress theme from html 400
    Last year I did a small (and admittedly very un-scientific) survey among other WordPress developers. What I wanted to know was this: When they built their first WordPress theme, how did they do it? Did they hack an existing theme or did they start with their own static HTML and turn it into a theme? The majority of people I spoke to used the second approach - they were all experienced frontend developers who had built sites using HTML and CSS, and found it easiest to take their existing HTML files and convert them to a theme. Two of the people I spoke to were lecturers or teachers, and told me that this is the approach they use with students. So in this series I'm going to show you how to do just that.Read More…
  • Code
    Theme Development
    How to Create a Homepage With Multiple Listings Using Custom QueriesFrontpage custom queries preview 400
    WordPress gives you a couple of built-in options for your website's front page: a display of your most recent blog posts or a static page of your choice. But what if you want to create something a bit more interesting than that? If your site has a lot of data using categories, taxonomies or custom post types to organize it, you might want to display data of more than one kind on your homepage. The good news is that you can do this using a custom template for the homepage. In this template you write a number of custom queries to list the data in the way you want to. In this tutorial you'll learn how to do the following: Create a custom homepage template for use by your theme Include four queries in that template to display different kinds of data, including three custom queries The queries will list standard posts plus one custom post type registered for this project, called 'animal'. You can find the template file with the four queries in the code bundle.Read More…