[Support request] Static Text Above The Featured Image

Home Forums Support [Support request] Static Text Above The Featured Image

Home Forums Support Static Text Above The Featured Image

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #1058276
    Jahid

    Hello

    Is there any way to add particular text/sentences right before each featured image.

    Want to display the text automatically on each post. Something like this one: https://ibb.co/2nzYbpj

    Thanks

    #1058383
    David
    Staff
    Customer Support

    Hi there,

    you can use the Hook Element:

    https://docs.generatepress.com/article/hooks-element-overview/

    The before_content hook is the one you want.

    #1058785
    Jahid

    Thank you so much!

    That’s what I wanted.

    One more question please. I used this following code in “before_content” hook.

    <center><font size="2"><p>This site is reader-supported. When you buy through links on our site, we may earn an affiliate commission. <span style="color:#3a3a3a;"<a href="https://demosite/disclaimer/">Learn more...</a></span></p></font></center>

    But now I see “learn more…” isn’t hyperlinked. What am I missing? :/

    Thanks

    #1058792
    Leo
    Staff
    Customer Support

    Maybe because you are missing > after <span style="color:#3a3a3a;?

    You can always use this site to check the HTML for you:
    https://validator.w3.org/

    #1058807
    Jahid

    Just tried but it’s still not fixed.

    #1058815
    Leo
    Staff
    Customer Support

    Where can I see the issue live?

    It is likely an HTML issue. Have you made sure all the errors are solved from the HTMl checker?

    #1058823
    Jahid

    I want to display that static text on Post only. You can check any Post on my site to see the live issue.

    Unfortunately I am very new to coding. Couldn’t solve the issue using HTML checker.

    I would really appreciate if you look up at my page and share the exact code that I should add to the Hook Element.

    Thanks

    #1058833
    Leo
    Staff
    Customer Support

    Looks like you’ve added the > inside the ", what if you added outside?

    #1058849
    Jahid

    Thanks you so much, Leo!

    It’s perfect now.

    BTW, is it possible to change the hyperlinked color here? I don’t want to use the default hyperlink color here.

    #1058853
    Leo
    Staff
    Customer Support

    You can use HTML inline style similar to the example here:
    https://www.w3schools.com/html/html_css.asp

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