[Support request] Inserting standard text in posts

Home Forums Support [Support request] Inserting standard text in posts

Home Forums Support Inserting standard text in posts

Viewing 9 posts - 16 through 24 (of 24 total)
  • Author
    Posts
  • #2209555
    Ying
    Staff
    Customer Support

    Try generate_after_content for this copy.

    #2209572
    Tom

    Still displays it too wide.

    https://travelpast50.com/day-hike-pack/

    #2209585
    Ying
    Staff
    Customer Support

    It matches your content container, but your CSS which set elements within entry content to be 700px doesn’t apply to this hook.

    How did you add this text? Are you using a hook element with HTML or a block element?

    You need to give the text a class, so we can add this class to your existing CSS:
    05.04.2022-14.21.29

    #2209590
    Tom

    was just using html

    can you send that css as text instead of a screen shot?

    #2209600
    Ying
    Staff
    Customer Support

    So you can add class like this:

    <p class="affiliate-notice"><em>your-text</em></p>

    Then edit your CSS to:

    .entry-content p, .entry-content ul, .entry-content ol, .entry-content h1, .entry-content h2, .entry-content h3, .entry-content h4, .entry-content h5, .entry-content > div, .entry-content blockquote, .comments-area, .affiliate-notice {
        max-width: 700px;
        text-align: left;
        word-wrap: break-word;
        margin-left: auto;
        margin-right: auto;
        clear: both;
    }
    #2209607
    Tom

    that works perfectly for line length

    is there a location so I can put it above the meta info?

    Thanks so much.

    Tom

    #2209617
    Ying
    Staff
    Customer Support

    In that case, switch to genearate_after_entry_content hook, set the priority to 1.

    #2209632
    Tom

    Perfect.

    Thanks so much.

    Now, one last (I hope) question.

    Can I use this scheme to put similar content under the first photo and caption in a post? Is there a location for that, or can we invent one?

    #2209656
    Fernando
    Customer Support

    Hi Tom,

    If you would like to hook to any location in your post, you may create a Portable Shortcode. Kindly see my response here on how to do it: https://generatepress.com/forums/topic/adding-an-automatic-disclaimer-to-my-posts/#post-2154753

    If you would like to automatically add it after every first image on a post, here is the way to do it: https://generatepress.com/forums/topic/adding-an-automatic-disclaimer-to-my-posts/#post-2154785

    Hope this clarifies. Kindly let us know if further assistance is needed. 🙂

Viewing 9 posts - 16 through 24 (of 24 total)
  • You must be logged in to reply to this topic.