Home Forums Weaver Xtreme Theme How to add the “last updated” information to a post’s top meta info line?

Topic Resolution: Answered
Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #68762
    Answered
    Tooni
    Participant

    I’m trying to add the “last updated” information to a post’s top meta info line.

    I already found an older question about this and the suggestion was to add the following custom CSS rule:

    <b>.updated {margin-left:1em; display:inline-block;}</b>
    <b>.updated:before {content:”Updated on “;}</b>
    When I add this to my custom CSS rules, the date is being displayed, but the text “Updated on” is missing completely. Can you give some advise, what I’m doing wrong?
    Thanks, Tooni
    #68763
    scrambler
    Moderator

    Please provide a link to the page with the post info lines

    #68764
    Private Reply
    Tooni
    Participant
    This reply has been marked as private.
    #68766
    Best Answer
    scrambler
    Moderator

    This reply has been accepted as the best answer.

    It is because you copy pasted the CSS and the double quotes where replaced by asymetrical ones.

    Retype the double quotes in the content property and it will work

    #68768
    Tooni
    Participant

    @scrambler: Wow, this is amazing! And very strange, because I could see the double quotes in my CSS rules. After retyping them, it works fine. Thank you so much!

    I have one more question: It there also a CSS rule which inherits the color and font weigth of the other meta line elements to the “last updated” field?

    Regards Tooni

    #68769
    scrambler
    Moderator

    Change the first rule to the one below with fonts properties

    .updated {margin-left:1em; display:inline-block;font-weight:bold;color:#1F2469}

    #68770
    Tooni
    Participant

    Thank you, @scrambler. However, this is the solution what I already found by myself.
    My question was, if it’s possible to inherit the settings of the other elements, so whenever I change some properties of the meta line, the updated field will change automatically?

    #68771
    scrambler
    Moderator

    No, the updated text is just regular text, the others are links, so they have a different styling.

     

    #68772
    Tooni
    Participant

    Okay, no problem. Thank you very much for your help and additional explanations.

    Regards Tooni

    #68773
    Tooni
    Participant

    Although my inital question is already answered, I’m interested in one more thing:

    Is it possible to have the “last updated” info displayed depending on a condition?
    For example I would like to display it only when the post really has been updated. When there wasn’t an update the field should not be shown. Is that possible?
    Or even more complicated: An update should not been shown when it happened in the first few days after publishing (because this can be considered as a minor error correction).

    It would be nice, if you find some time to think about this.

    Regards, Tooni

    #68776
    scrambler
    Moderator

    I do not know how you would do that exactly, but that would require PHP programing.

    If there was a way to that with PHP, and if you have the Plus Plugin, you could probably use the Plus Custom Meta Info line option to reformat your meta info line, including the PHP code.

    But depending of the PHP code (if it would be feasible), it may also require creating a child theme and editing the Theme Templates in it.

    I am not a PHP programmer, so you would need to research the PHP feasibility on WordPress.org

     

    #68782
    Tooni
    Participant

    @scrambler: Thank you for your assessment. I have to admit, that this goes far beyond my abilitities and so I will forget this idea very quickly. Anyway – I was just interested to know wether this could be done by CSS. If not, than it’s okay.

    Thank you again and best regards,
    Tooni

Viewing 12 posts - 1 through 12 (of 12 total)
  • You must be logged in to reply to this topic.