Code Conquest

  • Home
  • What is Coding?
  • Tutorials
  • Training
  • Reviews
  • Knowledge Center
  • Versus
  • Blog
You are here: Home / How To Get HTML Automatically Added Onto WordPress Posts Without a Plugin

How To Get HTML Automatically Added Onto WordPress Posts Without a Plugin

Do you have a WordPress blog? If you do, you’ll realize that one of the big advantages is its use of PHP to dynamically include the same chunks of HTML on multiple pages.

This page will be showing you how to use this feature to add an information box to the bottom of every post on your blog without a plugin.

An HTML element that’s always present

Scroll down to the bottom of the page. See the information box sitting under the main content? It’s automatically added onto the end of every page on this website.

This kind of information box is great if you run a blog, especially one that makes money, as you can use it to display info about yourself, or give your readers a ‘call to action’ after they’re done reading your article.

You may think this was included by means of a plugin, and there are no doubt plugins available to do this, but any WordPress user knows that plugins are notorious for slowing down your site. So when possible, you should take the opportunity to roll your own WordPress functionality instead of using a plugin, and this page will be showing you how to create an information box that’s automatically appended on to every post on your blog, just like the one you see here.

Put the HTML at the bottom of the single.php file

To create a box that automatically gets appended onto every post in your blog, the place you’ll need to put your HTML is at the bottom of the single.php file, which you can find under Appearance > Editor in your WordPress dashboard. On the right hand sidebar you can click onto single.php and edit the source code directly from your browser – no FTP required.

Make sure that the HTML goes before the comments code, otherwise your info box will get displayed after the comments section on your posts.

Add a call to action or two

As for what you can put in your information box, a call to action or two won’t hurt, such as encouraging your readers to leave a comment or subscribe. Alternatively write a short bio and link to your ‘about me’ page. This part’s really up to you.

Also make sure you give every element a class or ID, to make CSS styling easier later on. When doing this you want to make sure your class or ID name is not already taken by another element, or you might get a nasty CSS surprise later on.

Style your code with CSS

Now you’ve got your HTML all written out, it’s time to go into the style sheet (also accessible from the Appearance > Editor page in your WordPress dashboard) and style your content. If you’ve given your info box a class or ID name, you can use that as your selector, place it anywhere you like within the style sheet and code away.

And that’s it! A snippet of HTML that automatically appends itself onto every post on your blog. No need to manually paste the code onto each individual post you write, and no need for a plugin that slows down your site!

What other functionalities have you been able to add to your WordPress blog without using a plugin? Tell us!



Disclosure of Material Connection: Some of the links in the post above are “affiliate links.” This means if you click on the link and purchase the item, I will receive an affiliate commission. Regardless, I only recommend products or services I use personally and believe will add value to my readers.

Popular Series

  • What is Coding?
  • How to Make Your First Website
  • Understanding Hex Color Codes
  • How to Become a Coder in 6 Months: a Step-by-Step Action Plan
  • How to Start a Coding Project

Get Our Newsletter

Enter your email address and we'll notify you whenever we add something new to the site.

Popular Blog Posts

  • The 50 Best Websites to Learn Python
  • The 50 Best Websites to Learn JavaScript
  • The 50 Best Websites to Learn PHP
  • Want to Switch Careers? Coding May Be the Perfect Solution!
  • 9 of the Hottest Tech Skills Hiring Managers Look for on LinkedIn

Latest Blog Posts

  • Effective Strategies For Debugging Code
  • Effective Time Management Tips for Programmers
  • Code Documentation: Tools and Techniques
  • Is Data Analytics Hard to Learn?
  • Comparing Data Science vs Computer Science

Explore Code Conquest

  • What is Coding?
  • Free Code Tutorials
  • Coding Training Recommendations
  • Coding Training Reviews
  • Knowledge Center
  • Cheat Sheets
  • Coding Quizzes
  • Versus

Deals, Discounts and Coupons

Deals

Code Conquest

  • Home
  • About
  • Privacy Policy
  • Contact Us
  • Terms of Use
  • Write for Us
  • Featured Review

Copyright © 2025 Code Conquest · About · Terms · Privacy · Contact Us · Write For Us