Archived topic
Secondary Title in Generatepress
3 replies · Started by Jason on May 21, 2020
Hi there, I have used a plugin called Secondary Title to add a secondary title field, however what I’m trying to do is place it inside an element which I am using as my header.
I tried using {{custom_field.secondary_title}} but that did not work. The PHP they tell me to use in the theme is <?php echo get_secondary_title(); ?> — Is there any way I could get the subtitle into an element (or another method that would allow me to do so)?
I don't mind switching plugins, or adding something to my child theme's functions if that's what is necessary.
(It would be a bonus if the field appeared under the actual title instead of in the sidebar, but that's not a big deal.)
Thank you!
Hi there,
If you just want to display it within the header element, then you should be able to just use a custom field without another plugin:
https://docs.generatepress.com/article/header-element-template-tags/#custom_field-name
Oh!! I didn't even realize that feature existed in WordPress. Nice! Does exactly what I need, thank you so much :)
No problem :)