0

How to add a function to show a text (without JS) in every pages on Wordpress?

1
  • Please read How to Ask. Show us what you have tried, where and why you failed, and what your specific problem is.
    – fuxia
    Commented Mar 21, 2017 at 4:44

1 Answer 1

1

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.

Not the answer you're looking for? Browse other questions tagged or ask your own question.