How to Add Signature or Ads to WordPress Content

By default, WordPress provides a host of functions to effectively create a website, but one of the things that are not built in is the ability to add signature or ads after the post content. In this article, we will look at the different ways to place ads and to add a signature to your WordPress posts.

The Plugin way

Plugins are packages of code that extend WordPress capabilities to do anything. We are going to install “Insert Post Ads”, a plugin that allows us to insert ads after your post content.

To start with, navigate to Plugins > Add New in your WordPress Dashboard. Search for Insert Post Ads.

Install and activate the plugin by clicking on the Install Now button, which will change to the Activate button once installed.

Upon activation, navigate to Post Adverts > Add New Post.

We will create a new advert to be published after the content on your website. Choose a title, and enter any HTML Code / Signature or Ad Code that you want to display after the content.

Choose “After Content” in the drop-down titled Display the advert. Click on Publish to activate your advert.

Immediately after publishing, you will see a link to the Settings page. Click on the link to navigate to the settings page and choose where you would want to show the ads. For this example, we will choose just the posts and update the settings.

You can now visit any post on your website and see your ad/signature after the content.

The Manual Way

If you are not a fan of installing plugins and prefer to tinker with the code, here’s how you can do that.

Log into your HostPapa account.  Click on My cPanel and then on File Manager.

Your website’s file manager will now show up. From here, navigate to your root WordPress directory and then its theme folder (in this example, root WordPress directory is public_html, so the theme folder is in public_html/wp-content/themes/ location)

Inside your theme folder, we are looking to edit the functions.php file. Select functions.php and click on Edit to open the file in Editor.

Add the code below to the bottom of the file and click on Save Changes to save your code. Note: make sure you update the value of $content with your ad code/HTML or signature text you want to display.

  1. // Add signature or ad after post content
  2. function wpb_after_post_content($content){
  3. if (is_single()) {
  4.    $content .= ‘Your signature or ad code goes
  5. here’;
  6. }
  7.    return $content;
  8. }
    add_filter( “the_content”, “wpb_after_post_content” );

Reload your post/page now and you will see your content showing up underneath it.

Signatures often let the readers know something about the writer and add a personal effect, whereas adding ads to your post can get you additional income and exposure.





Leave a Reply

Your email address will not be published. Required fields are marked *