ThemeShaper Forums » Thematic

changing entry-meta

(6 posts)
  • Started 12 years ago by jknox
  • Latest reply from jknox
  • This topic is not resolved
  1. jknox
    Member

    Hi, I've begun to play around with child themes and I know a bit of php, but I can't quite figure this out. When I try to exchange the code for the author name in postheader function with the_time(g:i a); it puts it on top of the page title instead of infront of the date. What's going on?

    Posted 12 years ago #
  2. amygail
    Member

    can you post the function?

    Posted 12 years ago #
  3. jknox
    Member

    function childtheme_postmeta() {

    $postmeta = '<div class=child-meta>';
    $postmeta .= 'Published ';
    $postmeta .= the_time(g:i a);
    $postmeta .= ' <div>';

    return $postmeta;
    }
    add_filter('thematic_postheader_postmeta','childtheme_postmeta');

    I simplified it to play around. I'm not sure what I'm doing wrong. Just shows a blank page.

    Posted 12 years ago #
  4. jknox
    Member

    BTW I fixed the 's in the time function, that was the blank screen. But it's back to the original problem of posting time above the title and "published" below.

    Posted 12 years ago #
  5. the_time() echoes the time directly, you should use get_the_time() to retain it in a variable.
    And you should check the codex (again 8-), and deeply ):
    http://codex.wordpress.org/Function_Reference/get_the_time
    http://codex.wordpress.org/Template_Tags/the_time

    Posted 12 years ago #
  6. jknox
    Member

    Thanks, pauloc! I think it's php itself I need to look at a little more closely. The echo vs. return problem wasn't registering with me. But thanks for pointing me in the right direction. I learn the most from my mistakes!

    Posted 12 years ago #

RSS feed for this topic

Reply

You must log in to post.