Archived topic
Auto Disclaimer message
7 replies · Started by Rachel on August 14, 2018
Hi, I would like to automatically include a short disclaimer message under the title of my posts and also pages (if possible).
I don't want this message to be included in the excerpt or be treated as part of the content. I would prefer it to be lightly coloured and hyperlinked to the disclaimer page. Is there a way to include it as a meta tag for the post / page?
Example: "this page may contain compensated links. For more information read our disclaimer here."
Is there a way to do this?
Thanks.
Hi Rachel,
You can hook it into your pages uses a Hook element: https://docs.generatepress.com/article/hooks-element-overview/
For example:
<div class="notice">
This page may contain compensated links. For more information read our disclaimer <a href="URL HERE">here</a>.
</div>
So if placed the code in the generate_after_entry_title hook would it display under the post title and page title or do I need to put it in two hooks? Also, will it be picked up in the excerpt?
It should display in both areas.
It will only display above the excerpt (below the title) if you choose to display on the blog/archives within the Display Rules.
Ok thanks. If I want the text to adopt the same font as the other meta information, how would I do that?
Try giving it this class:
<div class="notice entry-meta">
Works perfectly. Thanks so much for your help. Loving this theme and the support!
You're welcome!
Glad you're enoying GP! :)