How to add a function to show a text (without JS) in every pages on Wordpress?
1 Answer
Where do you want it to appear?
this function will put something before, or after, the content of each page.
function rt_before_after($content) {
$beforecontent = 'This goes before the content.';
$aftercontent = 'And this will come after.';
$fullcontent = $beforecontent . $content . $aftercontent;
return $fullcontent;
}
add_filter('the_content', 'rt_before_after');
If you want it somewhere in particular let me know where you want and I'll provide other options.