• Resolved clouder

    (@clouder)


    I created a shortcode to use within my posts so that I can create a custom message and it will appear on all of my posts.

    The problem is that the message keeps appearing at the top of the post.

    the function I created looks like this

    function postMessage() { 
    
    echo "<div id=\"postmessy\">Testing testing</div>";
    }
    
    add_shortcode('postmess', 'postMessage');

Viewing 1 replies (of 1 total)
  • Thread Starter clouder

    (@clouder)

    Nvm just realized I needed to use return instead of echo

    This question helped me understand the difference between echo and return for anyone whose having the same problem. LINK

Viewing 1 replies (of 1 total)
  • The topic ‘Div keep appearing at the top of the page’ is closed to new replies.