- This topic has 15 replies, 3 voices, and was last updated 5 years, 5 months ago by David.
-
AuthorPosts
-
September 5, 2018 at 6:38 pm #669901Rachel
Hi,
I would like to add some standard text in italics at the base of most posts and some pages.I have played with the different hooks but can’t find one that will place the text at the end of the post content but before my social share icons.(social warfare)
The after_content hook displays after the post category meta and the social shares, the after_main_content appears after comments box.
Could you please advise which hook will display in the area I am trying to add to?Thanks,
RachelSeptember 6, 2018 at 4:10 am #670166DavidStaffCustomer SupportHi there,
so by default Social Warfare filters the_content to place their icons.
So instead you could use the SW shortcode:https://warfareplugins.com/support/using-shortcodes-and-php-snippets/
Then you could try adding your type followed by the shortcode inside the
after_content
hook and change the priority to a lower number (it defaults on 10). This should hook it above the entry meta.September 6, 2018 at 6:43 am #670240Rachelhmm, I can’t seem to get anything to display when using the after_content hook. I am not tech, so do I need to code the shortcode in a certain way within the hook to display correctly?
September 6, 2018 at 6:52 am #670254DavidStaffCustomer SupportIf you’re using the GP Elements > Hook then you just need to Check the Execute Shortcode and set the Display Rules.
https://docs.generatepress.com/article/hooks-element-overview/
September 6, 2018 at 3:18 pm #670649RachelOk, did that. It is now showing above the SW social share, but still below the meta tags with the priority set to 1. Not sure how to get it to hop above the meta data- any ideas?
September 6, 2018 at 7:45 pm #670769TomLead DeveloperLead DeveloperHi there,
Try the
generate_after_entry_content
hook instead with a low priority.Let me know ๐
September 6, 2018 at 9:16 pm #670816RachelHooray – that worked. Thank you. Sorry for the very basic questions, but can you advise how I can adjust the text font and colours of the text in this hook? Is there a place I can find the class for certain styles? Thanks.
September 7, 2018 at 8:17 am #671252TomLead DeveloperLead DeveloperYou can add an element with a class around your content, then apply CSS to it:
<div class="my-element"> My content </div>
Then your CSS:
.my-element { color: #777777; }
September 7, 2018 at 4:44 pm #671540RachelThank you! I really need to find a good intro to css course…
September 7, 2018 at 7:01 pm #671587TomLead DeveloperLead DeveloperCodecademy is pretty cool: https://www.codecademy.com/
September 7, 2018 at 7:43 pm #671609RachelThanks for the tip. Cheers.
September 7, 2018 at 9:36 pm #671649TomLead DeveloperLead DeveloperNo problem ๐
October 30, 2018 at 8:47 pm #715109RachelHi, So I have been using this element to add standard text to the bottom of posts, but it doesn’t show up for pages. I have set the custom hook element with the display rules all singular, plus added individual pages in the location section, but no luck.
Is there a way I can specify this hook to be displayed at the base of specific pages? Thanks.October 31, 2018 at 4:55 am #715370DavidStaffCustomer SupportHi there,
you would need to create a separate Element Hook and use one of the available hooks for the static pages, this guide displays where they are:
https://docs.generatepress.com/article/hooks-visual-guide/#static-page
October 31, 2018 at 4:51 pm #716008RachelOk, thanks – that worked. Cheers. Will save that link for later!
-
AuthorPosts
- You must be logged in to reply to this topic.