[Resolved] modify metadata

Home Forums Support modify metadata

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #274318
    Steven

    I have two questions (currently!) related to metadata.
    1) I’d like to append some text to the author byline.
    Instead of “by Vicki Nelson” I want the byline to read “by Vicki Nelson, Founder, College Parent Central”
    I tinkered with inc > template-tags.php in the GeneratePress theme folder and got it to do what I want, but when I tried adding am inc folder with that one file in it to a child theme folder it stopped working.
    How can I add a string of text to the byline in a way that will withstand Theme updates?

    2) I’d like the publication date to show when in recent post excerpt listing view, but *not* when in single post view. Where would I adjust that? I only have the option to show/hide date in the customizer.

    Thank you for any help you can offer.
    Steve

    GP Premium 1.2.94
    #274443
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    You should be able to change your “Nice name” in “Users > Your Profile”. That’s the name that shows up on the website.

    Give this CSS a shot:

    .single .posted-on {
        display: none;
    }
    #274542
    Steven

    Those tips help me a lot to understand the theme’s strategy. I was pretty sure filters weren’t going to do what I needed but, coming from a “code it” orientation, the “set it and selectively hide it” approach isn’t immediately intuitive. Thanks so much!
    Steve

    #274623
    Tom
    Lead Developer
    Lead Developer

    You could use a filter as well if you wanted: https://docs.generatepress.com/article/generate_post_author

    Glad I could help 🙂

    #274777
    Steven

    Thank you, Tom.
    I need to get familiar with filters.
    I viewed a filter as a binary, yes/no toggle, not something which could carry a custom string.
    I’ll turn my attention to learning more about this tool but for now your simpler solution seems to meet the current need.
    I do still sort of wonder why the modified inc>template-tags.php file in the child theme didn’t appear to get executed but again – for another day. Thank you again.
    Steve

    #274873
    Tom
    Lead Developer
    Lead Developer

    Filters can be anything from strings, booleans, arrays etc.. They’re awesome.

    You don’t want to overwrite the entire template-tags.php file in your child theme. If I add a function in there and call it in another file, you would get a fatal PHP error when you updated.

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