I’ve gotten a lot of questions about how to edit the meta information under the post/page titles. This is what the code that generates these four text lines looks like right out of the box, albeit with some extra line spaces between the lines of code to make it easier to read.

Let me describe each line and how to edit them for different treatments. But before you start editing the index.php (Appearance > Editor) remember that you’ll need to make these code edits again for future edits, unless I add a future feature that makes code edits obsolete.

<div class=”meta”>

The first thing to notice is that the whole section is wrapped in a <div> tag that can be styled with a CSS in the Custom CSS field on the Edit Basic Simplicity page. This is an example of a style that would make the text smaller: .meta { font-size:80%; }

<?php edit_post_link(‘Edit’, ”, ”); ?>

This generates the edit link for administers of your blog. You should just leave this here to make it easy to edit your posts and pages.

<?php if(is_page()) { ?> (open a conditional statement, if is this a page then show the following)

<!–nothing–> (hidden text, if you wanted something to show for a page you could put it here)

<?php }else{ ?> (if this not a page then show the following)

and filed in (visible text)

<?php the_category(‘, ‘) ?> (displays the category)

<?php } ?> (end of the conditional statement)

</div> (closes the line of text)

The main trick with editing this bit of code is not to mess up order the conditional stuff ans the spaces around the brackets and php tags. If you keep it in the order I have here and just put the things you want to show and hide on pages and posts you can customize what happens on posts and pages.

You can also use this little conditional trick in other parts of the theme. Here’s a clean bit of code you can use:

<?php if(is_page()) { ?>

THIS IS A PAGE

<?php }else{ ?>

THIS IS NOT A PAGE, USUALLY A POST

<?php } ?>

<div class=”meta-tags”><?php the_tags( ‘Tags: ‘, ‘, ‘, ”); ?></div>

This is the tags line. You can hide this on the Edit Basic Simplicity page or even move it down to the bottom of the post by sticking it right before </div><!–end the_content–> in the index.php file.

This closes the whole meta section. It looks super simple but don’t forget this closing ‘div’ tag of the whole page breaks.

Conclusion

Three of these four lines, (posted by, tags, and comments), can be shown and hidden from the Edit Basic Simplicity page in version 1.4.1 but I’ve not added any feature for distinguishing their visibility between pages and posts. I will add this in a future release because it is regularly requested.