ThemeShaper Forums » Thematic


post-meta above the post-title

(6 posts)
  • Started 9 years ago by @soren
  • Latest reply from flick
  • This topic is resolved
  1. Hello!
    I am new to wordpress and thematic and no skills in PHP. I have searched for a way to put the post-meta on top of the post-title and to have a custom field below the post-title, tried several PHP functions by copy and paste, no success so far. I love the way has done it and trying to do the same. Where can I find a code that will work the same way? I also wonder how you get the custom field to show up on the blog. Is it similar to the "more" functions when you are writing the post in wordpress?


    Posted 9 years ago #
  2. @soren: This forum thread looks really helpful: Introducing Custom Fields into Thematic.

    In the above link, the user wanted to add a thumbnail image to posts displayed on their index page, where the name of the thumbnail is defined in the custom field. (Am guessing this can be done now with the_post_thumbnail)

    And if you just wanted to post the meta-data above the post title, the usual filtering of thematic_postheader function is sufficient I believe.

    /// Post meta above title///
    function meta_above_title($thepostheader) {
        global $post;
          if(is_page() || is_404()){
    	  $thepostheader = thematic_postheader_posttitle();
        } else {
          $thepostheader = thematic_postheader_postmeta() . thematic_postheader_posttitle();
    	return $thepostheader;
    add_filter('thematic_postheader', 'meta_above_title');
     // End post meta above title ///

    So I think you could potentially combine the two to achieve what you wanted to do.

    Posted 9 years ago #
  3. Thanks!

    That worked great, next step is that I want only the post entrydate to show up on top of the posttitle as well as comments same as the I tried first to only show the date on top of posttitle...

    $thepostheader = thematic_postheader_postmeta() . thematic_postheader_posttitle()
    $thepostheader = thematic_postheader_entry-date() . thematic_postheader_posttitle()

    tried several (entry-meta-entry-date etc) option I could think of but none of them worked...


    Posted 9 years ago #
  4. @soren: thematic_postheader_postmeta() actually includes thematic_postheader_entrydate which I think is why it wouldn't work.

    I found looking at content-extensions.php really helps. For instance, you can tell that thematic_postheader_postmeta() includes thematic_postheader_entrydate because of this bit:

    // Create post meta
    function thematic_postheader_postmeta() {
        $postmeta = '<div class="entry-meta">';
        $postmeta .= thematic_postmeta_authorlink();
        $postmeta .= '<span class="meta-sep meta-sep-entry-date"> | </span>';
        $postmeta .= thematic_postmeta_entrydate();
        $postmeta .= thematic_postmeta_editlink();
        $postmeta .= "</div><!-- .entry-meta -->\n";
        return apply_filters('thematic_postheader_postmeta',$postmeta); 
    } // end thematic_postheader_postmeta

    So essentially you will need to filter thematic_postheader_postmeta() to change the order, as the default setup shown above is



    Posted 9 years ago #
  5. As my PHP knowledge is very limited, I tried to find a similar filter like this
    function noeditlink() {

    It worked by removing the “edit”

    So I change it to
    function noauthorlink() {

    But that did not work at all.. also tried postmeta_authorlink.

    Also if you remove by using filter, I guess you are not able to return it back to another position?

    What I need is the Entrydate and Comments to go on top of the Posttitle and the authorlink to show up below the Posttitle.

    Posted 9 years ago #
  6. @Soren: I think the name of that particular function is thematic_postmeta_authorlink().

    EDIT: Note to other users: please also refer to this thread for more solutions.

    Posted 9 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.