• Is there a way to embed a CSS span string in the New Post text area, so that it automatically appears at the bottom of each post and I don’t have to enter it manually enter it every time I create a new post? Here’s the string:

    <span class="cred">Greg Gross is the Publisher/Sr. Editor of "I'm Black and I Travel!," and the owner of the <a href="https://tripsbygreg.com" target="_blank">Trips by Greg</a> travel agency.</span>

    Thanks.

    https://imblacknitravel.com

Viewing 5 replies - 1 through 5 (of 5 total)
  • Use a child theme.

    You can then copy over single.php (or whatever file your current theme uses) and add that at the bottom of the content.

    Thread Starter galan05

    (@galan05)

    That sounds like something beyond my skillset, since I don’t know PHP. Is there an alternative?

    Hi,

    It is always recommended the to create child theme whenever you want customizations. If you modify a theme directly and it is updated, then your modifications may be lost. By using a child theme you will ensure that your modifications are preserved.

    Here are the excellent and easy guides on how you can make child themes:

    https://www.wpbeginner.com/wp-themes/how-to-create-a-wordpress-child-theme-video/
    https://premium.wpmudev.org/blog/how-to-create-wordpress-child-theme/

    Thanks,

    Thread Starter galan05

    (@galan05)

    I’ve created child themes before; the blog is currently using one. I don’t know how to do what I want to do in this specific case within the child theme. I know CSS, but not PHP.

    You dont need to know PHP do edit the PHP file as the text you are inputting is HTML.

    Go into the original theme folder (not your child theme) and copy single.php (might be called post.php, single-post.php) whatever file your post currently uses.

    Then, paste it into your child theme location. You can then edit it directly from the WP dashboard (Appearance >> Editor >> Select file)

    Then past that code at the bottom, just inside the closing PHP tag.

    If in doubt, post the file here and we can let you know where to post it…

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Embed CSS in text area’ is closed to new replies.