I need to insert a DIV that contains ad code at a specific location in every post. Since I may change ad networks later, I don't want to have to go back and revise old posts. I'd like to have a place where the ad code is written once, and then called into the posts at the location where I want it.
What's the best way to set this up? I was thinking that it would be a custom function, but if there is a better way I'd like to know.
ourlifeintext
Member
Posted 2 years ago #
just insert the div code into your singlepost.php page?
Unfortunately I need to split the content of the post, with the ad code DIV. So I need to place it in the middle of the post content. It needs to be a line of code that is in each post that goes and gets the DIV. I don't want to write the entire ad code in each post since I may change ad networks.
read up about 'shortcodes' in wordpress
http://codex.wordpress.org/Shortcode_API
and check plugins if you haven't done yet.
I would definitely go with shortcodes.