How do I make plugin's content appear in a place I want? For example let's say I have a plugin that output's a paragraph:

echo "<p>foo<p>"

If I do this it will appear on a page outside the DOM. How to make it append for example just before the end of body using PHP?


Hook the wp_footer action to output markup before </body>:

function your_function() {
    echo '<p>foo</p>';
add_action('wp_footer', 'your_function');

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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