With a multi-user blog, how can I add a posted by Some Author line, or something similar, at the top of each post, as in this blog? I assumed this should be something very basic, and there should be a setting for it, but I can’t seem to find it anywhere.
3 comments
Comments are closed.
A plug-in might use
the_content
filter to append / prepend this, but if you’re a theme author or otherwise are able to edit the the theme templates directly.In this case you want to edit your theme’s
single.php
. (You can always check which template file is being used by a particular page using this answer: https://wordpress.stackexchange.com/a/10565/9364).single.php
is used for single posts, and other post types if they do not have their own template (you see how WordPress decides what template to use here).In
single.php
you should find something likeWhich includes another file depending on the post’s format. For a normal post, this will be
content.php
. (Please note this may vary by theme – the upshot is that you want to find where it callsthe_content()
) –the_content()
is what displays the post content.Below that you want to add something like:
(see codex). Check the TwentyTwelve theme for more ‘involved’ example.
With the twenty-twelve theme, the following is in
style.css
:This was the source of the problem and it needed to be commented out.
Short answer, but it sounds like what you want is
the_author
.The Codex page for that function has an example of what you want, I think:
You will have to edit that into one or more of your theme templates but without having the code for the theme I can’t say where.