The benefit of using WordPress to power your blog is that you don’t need to edit any PHP files and use thousands of ready themes available for free. If you’re like me, you’d prefer to keep away from major editing of the theme files and prefer to use the right assortment of plugins to get the job done. If you’re looking to add text before post content in WordPress, you can either edit your theme files or check out Add to All, a plugin I released a while back.
Add to All is a powerful plugin that will allow you to add custom code or CSS to your header, footer, content or feed.
Add to All comes with out of the box support for Google Analytics, Statcounter, Kontera, with other third party services in the pipeline. With this plugin installed, you do not need to edit your theme files every time you switch themes. You can also add custom CSS styles to your header as well as any HTML code to the header or footer of the theme. The plugin gives you the power to add content to your feed in addition to adding a copyright notice. This is especially useful if you have any website scraping your feeds.
Step 1: Install Add to All
- Navigate to Plugins within your WordPress Admin Area
- Click “Add new” and in the search box enter “Add to All” and select “Keyword” from the dropdown
- Find the plugin in the list (usually the first result) and click “Install Now”
As you can see in the screenshot above, I already have this installed on Techtites
Step 2: Add Text before Post Content
Navigate over to the plugin settings page. You’ll find this under Settings » Add to All.
The plugin is feature rich and gives you tonnes of options and you can easily access them by clicking on the relevant tabs. For us, we need to navigate to the Content Options tab.
As shown in the screenshot above, simply enter the HTML that you would like to display before the post content.
If you scroll further down this page, you’ll find options to display custom text before or after content either on single pages or sitewide. I use my Adsense code in the box above to display ads before and after the post content on single pages.
The last set of options in this tab is Adjust content filter priority. This option allows you to control when WordPress should process this content and display it. By default all filters are set to 10, so if you want this content to be added last, then set it to a large number. I’ve set it to 999 and this allows me to display the ads first of all, just below the title on this site.
Do you think this helps you on your blog? Do you use any other method to display text or other content in your posts?