• Resolved qpqpqp

    (@qpqpqp)


    Using WordPress 3.5.1. Falling Leaves theme.

    Currently, my template displays this info at the start of each new post:

    “Posted 4:21 pm, Wednesday, April 17, 2013” (or whatever the date is).

    What I want it to say is:

    “Posted by [my username] at 4:21 pm, Wednesday, April 17, 2013.”

    I presume this can be changed using the “Editor / Edit Themes” function under “Appearance” in the Dashboard sidebar.

    It seems the most likely template that needs to be edited to make this change would be either “Main Index Template,” or possibly “Single Post.”

    The problem is, I don’t see anything in the existing Falling Leaves code that seems to be an option for including a post’s author name to toggle on or off, so I’d have to add the code from scratch — something I have no idea how to do, since I know next to nothing about php or CSS or whatever it is.

    In the “”Main Index Template” for the Falling Leaves template I see this code:

    <div class="post">
    	 <h2 class="storytitle" id="post-<?php the_ID(); ?>"><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h2>
    	<div class="date">Posted <?php the_time('g:i a'); ?>, <?php the_time('l') ?>, <?php the_time('F') ?> <?php the_time('j') ?>, <?php the_time('Y') ?></div>
    
    	<div class="storycontent">
    		<?php the_content('Read on »'); ?>
    	</div>

    It would seem likely that whatever I need to add to make “Posted by [my username]…” visible, it should be added somewhere in there.

    What makes this tricky is that my blog has two separate admin users, each logging in with a different user name, and both making posts — and I want each author’s post of course to say “Posted by [this-particular-author’s-actual username]…”. In other words, the displayed user name needs to be dependent on who actually posted the post, and not be a static name in the template.

    Any clue about how I can achieve this? I know it must be possible because lots of other blogs and themes have this feature — I simply need to know what code to use, and where to paste it in. Thanks.

Viewing 10 replies - 1 through 10 (of 10 total)
  • W.P. Ginfo

    (@wp-ginfo)

    Many themes allow you to edit the settings and set what meta data to display.
    First: Check ‘theme optios’ to see if your theme has such options available. If not: contact the authors of the theme / it’s support forum [falling leaves theme is a premium theme]

    Thread Starter qpqpqp

    (@qpqpqp)

    Hmmmmm…where is this “Theme Options” I am supposed to check? I can’t find it. Is it something on my “Dashboard”? I just went through every single option on my Dashboard and the only thing that relates to the theme is “Appearance.” There, when I click on “Appearance,” there are two choices: “Themes” and “Editor.”

    If I click on “Themes,” it says I am using “Falling Leaves,” and if I click on “Customize,” the only two attributes it allows me to customize via this method are “Site Title and Tagline,” and “Static Front Page.”

    If I click on “Editor,” it takes me to the “Edit Themes” page, which is what I discuss in my original question. I seems that this MUST be the place to edit the template’s settings, and it definitely seems possible — if only I knew the code to paste in (which I still don’t know).

    As for contacting the theme’s author: the home page for the theme given in the code (http://www.hexfactor.com/wordpress/) is defunct — the page no longer exists. Furthermore, I can’t find “Falling Leaves” anywhere on WordPress’s site. Combining these two clues, I presumed that Falling Leaves is an obsolete theme and no longer maintained (The version I have is from about five or six years ago, and back then it was free). I tried to find the author through a general Web search, but had no luck. If it’s now a “premium theme,” where do I find it?

    If I’m barking up the wrong tree, and “Theme Options” is somewhere else besides my Dashboard, please point me where to go. Alternately, I’m still seeking an answer to my original question — what code to paste in to “Main Index Template” to add the author’s name to each post (which I presume must be a common/standard bit of code).

    esmi

    (@esmi)

    where is this “Theme Options” I am supposed to check?

    As W.P. Ginfo posted above, not all themes have an options page. It seems yours, for example, does not. As we do not support themes downloaded from anywhere other than wordpress.org, we cannot help you with this one. I’d suggest you start looking for a new theme. There are almost 2,000 free quality themes to chose from at http://wordpress.org/extend/themes/

    Thread Starter qpqpqp

    (@qpqpqp)

    As far as I remember, I DID download this “Falling Leaves” theme from wordpress.org — it’s just that it was from several years ago, and no longer seems to be offered. Do you also not allow answers about themes that are now no longer available here (but once were in the past)?

    Anyway, this question isn’t really about this theme in particular — I presume the same (or very similar) code could be used in just about any WordPress theme’s index template, and an answer posted here would help and apply to any one seeking a similar answer for any other theme as well.

    For example, in my amateur attempts to find the code myself, I found that some other WordPress themes which do show “Posted by [username]” have this code in their index templates:

    <span class="author">Posted by <?php the_author_posts_link(); ?>&nbsp;<?php edit_post_link(__(' Edit'), '|', ''); ?></span>

    Am I getting close? Would pasting this (or something like this) at the appropriate place enact the change I seek?

    esmi

    (@esmi)

    Do you also not allow answers about themes that are now no longer available here (but once were in the past)?

    Not if the theme hasn’t been updated in more than 2 years or the theme developer has asked for it to be removed. In short, if you cannot find the theme using the search on http://wordpress.org/extend/themes/ then we do not support it.

    Thread Starter qpqpqp

    (@qpqpqp)

    Well OK, even if this WordPress theme is no longer officially “supported,” can my question remain here in the forum in case a helpful fellow user by chance knows the answer anyway and posts a response here? Especially since the answer mostly likely will apply to most current themes as well, and would thereby be a useful addition to the knowledgebase.

    esmi

    (@esmi)

    With a 5 or 6 year old theme? Highly unlikely.

    Especially since the answer mostly likely will apply to most current themes as well

    No it won’t. Every theme is different and this goes ten-fold for such an old theme. Seriously – do yourself a favour and get a more up-to-date theme.

    Thread Starter qpqpqp

    (@qpqpqp)

    We really like the Falling Leaves theme and only decided on it after a long search. Everything else about its design is exactly what we want. All that remains is this one tiny change. To start all over again searching for a new theme, which itself will likely have to be customized as well in other ways, would take a lot more time than finding out how to make this one little fix in the theme that we have.

    Actually, there are several people involved in the blog and they all also want to stick with Falling Leaves. To choose a new theme would open a big new can of worms.

    I’ll keep trying to figure out how to add this “Posted by…” line, and meanwhile I only ask that you leave this unanswered question in the forum on the off-chance someone replies with an answer (or with info pointing me toward an answer). Thanks.

    Thread Starter qpqpqp

    (@qpqpqp)

    Well, it looks like I’m on my own with this one, so I continued trying to figure it out by myself — and was surprisingly successful!!!

    As I suspected, the solution was very easy. I figured out what code to use by searching for other themes that already have the “Posted by…” line built in, and then inspecting their index template files. Turns out the most commonly used code was simply

    Posted by <?php the_author() ?>

    …and that’s it!

    So I took that exact code and pasted it in my Falling Leaves index file where it says

    <div class="date">Posted <?php the_time('g:i a'); ?>...

    and changed it to

    <div class="date">Posted by <?php the_author() ?> on <?php the_time('g:i a'); ?>...

    …and voilà, it worked like a charm!

    If anyone else in the future wants to add a “Posted by [author_name]…” component to their posts’ headers, just follow these instructions and hopefully it will work for your theme too.

    (But always save a pristine copy of your index template while experimenting, in case it doesn’t work and you want to restore things to the way they were.)

    Count this question as “resolved” (by me).

    Dude, thank you. That was exactly what I need too.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘How to add "Posted by [username]" next to the date on each new post?’ is closed to new replies.