Site logo

Archived topic

modify metadata

5 replies · Started by Steven on February 4, 2017

Viewing posts 1–6 of 6

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

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;
}

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

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

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.

This archived topic is closed to new replies.