ThemeShaper Forums » Thematic

[closed]

Meta above and below the posttitle not working

(8 posts)
  • Started 14 years ago by @soren
  • Latest reply from kiper
  • This topic is resolved
  1. Hello!
    Tried to "split" the meta to be above and below the posttitle, but when using this code I only get the author below and not the entrydate above the posttitle, do I remove the authorlink I get the entrydate above the posttitle... what is wrong?

    function meta_split_title($thepostheader) {
    global $post;
    if(is_page() || is_404()){
    $thepostheader = thematic_postheader_posttitle();
    } else {
    $thepostheader = thematic_postmeta_entrydate() . thematic_postheader_posttitle();
    $thepostheader = thematic_postheader_posttitle() . thematic_postmeta_authorlink();
    }
    return $thepostheader;
    }
    add_filter('thematic_postheader', 'meta_split_title');

    Soren

    Posted 14 years ago #
  2. Hi Soren,

    try this code:

    function meta_split_title($thepostheader) {
    global $post;
    if(is_page() || is_404()){
    $thepostheader = thematic_postheader_posttitle();
    } else {
    $thepostheader = thematic_postmeta_entrydate();
    $thepostheader .= thematic_postheader_posttitle() . thematic_postmeta_authorlink();
    }
    return $thepostheader;
    }
    add_filter('thematic_postheader', 'meta_split_title');

    Chris

    Posted 14 years ago #
  3. @Soren: Good job on sorting out the code side of things. I have put a link to this thread from your other thread. Probably easier for people to refer to in the future.

    http://forums.themeshaper.com/topic/post-meta-above-the-post-title

    Posted 14 years ago #
  4. Chris and flink,

    Thanks, but there are some problems with the code. I get a questionmark when moving the mouse pointer over the entrydate and the authorlink I have a hard time to change color on. It is darker then the entry-date and I spent half day trying to change it but I had to give up for the moment. I read many post on the forum and trying to use part of codes here and there copy and paste and see what's happen. When you are a beginner for PHP code, I find it very hard to make it work. Some things work but then other things get messed up...

    Posted 14 years ago #
  5. @soren: I think it's probably easiest to find the CSS tag for e.g. the authorlink (using the Firefox extensions Webdeveloper or Firebug) and then amend/override accordingly in style.css?

    I'm still learning about Thematic/frameworks etc. as well, so I find looking through the forums very helpful. Great thing is if something messes up, one can always delete it out of the child theme functions.php :p

    Posted 14 years ago #
  6. I have finally got this code that seems to work for what I want. One thing I wonder about is when you put your mousepointer over the entrydate a questionamark "?" shows up. What is wrong there? Next I would like to put "meta-sep-tag" on both sides of the "[" postcoments "]", how would I do this with the code below?

    Thanks


    function meta_split_title($thepostheader) {
    global $post;
    if(is_page() || is_404()){
    $thepostheader = thematic_postheader_posttitle();
    } else {
    $thepostheader = thematic_postmeta_entrydate() .thematic_postfooter_postcomments();
    $thepostheader .= thematic_postheader_posttitle() . thematic_postmeta_authorlink();
    }
    return $thepostheader;
    }
    add_filter('thematic_postheader', 'meta_split_title');

    Posted 14 years ago #
  7. @soren: for future reference - the questionmark appears because of the <abbr>, abbreviation HTML tag, in the code for thematic_post_meta_entrydate.
    I guess there is some semantic reasoning behind this but it is possible to remove this.
    Just put this in your child themes functions.php:

    // Create custom entry date for post meta
    function child_postmeta_entrydate() {
        $entrydate = '<span class="meta-prep meta-prep-entry-date">' . __('Published: ', 'thematic') . '</span>';
        $entrydate .= '<span class="entry-date">';
        $entrydate .= get_the_time(thematic_time_title());
        $entrydate .= get_the_time(thematic_time_display());
        $entrydate .= '</span>';
    
        return $entrydate;
    
    } // end child_postmeta_entrydate()
    add_filter('thematic_post_meta_entrydate', 'child_postmeta_entrydate');
    Posted 13 years ago #
  8. For even more reference:
    Just saw this in the CSS:

    abbr, acronym {
    border-bottom:1px dotted #333333;
    cursor:help;
    }

    If you remove or change the cursor:help; then you will change the cursor back to default or you could set it to something else...

    Most of the time there will always be a simpler answer. ;)

    Posted 13 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.