How to Insert Code after More Tag in WordPress Post Page

AD

Tag Archives Binary Options Trading Philippines

check Exit Of News Forex Today Cues

http://ideas.kanojo.de/?p=Can-You-Get-Rich-From-Binary-Option-Forecasts Can You Get Rich From Binary Option Forecasts

http://fromvalskitchen.com/?p=Bonus-For-Opening-Of-The-Account-Forex-2016-50 Bonus For Opening Of The Account Forex 2016 50

It looks like this in WordPress:

<span id="more-xxx'"></span> //xxx represent the post ID

Lets Begin!

Always remember a golden rule while editing your code: MAKE A BACKUP OF THE FILE YOU ARE EDITING!

Go to Your WordPress Admin ->Appearance -> Editor -> (Theme Functions) Functions.php

Add this code in it:

add_filter('the_content', 'adds_block');

function adds_block($content){
 if (is_single())
 global $post;
$thePostID = $post->ID; // getting the post ID
$new_insert = '<span id="more-' .$thePostID.'"></span>' ;
 return str_replace($new_insert, my_ad(), $content);
 }
function my_ad(){
 return ' Your Ad Code '; // What you want to display in place of the more tag. can be a custom code, advertisement etc.
}

This code will replace the <span id=”more-xxx”></span> with your ad added above in my_ad() Function.

Let me know in your comments that what you think about this new category and how can we improve it.

Further Related Readings

Copyrights © 2016 - Designzzz. All Rights Reserved