Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #657085

    Hi,

    I’m having an odd issue. When I create a shortcode and place it in the page using the advanced editor, it appears right at the top of the rendered page, completely out of order. I have tried placing the shortcode in both a code block and a text block, but the result is the same.

    I have tried the same code on a second Enfold website and I get the same result.

    As I can’t find any search results to show others having this issue, I assume I’m doing something dumb!

    I’m creating the shortcode in functions.php, for example:

    
    function test_shortcode( ) {
    ?>
    <h2>My Shortcode</h2>
    <?php }
    add_shortcode( 'shortcode', 'test_shortcode' );
    

    Any advice very much appreciated. What little hair I have left is being pulled out!

    Regards,

    Ash

    #657088

    Hey ashloudon!

    Please change your code to following one

    function test_shortcode() {
    $output = "<h2>My Shortcode</h2>";
    return $output;
    }
    add_shortcode( 'shortcode', 'test_shortcode' );

    Regards,
    Yigit

    #657094

    Simple! I knew I was being dumb. Thanks :)

    However, how do I pass WP Query arguments through this method?

    • This reply was modified 8 years, 4 months ago by ashloudon.
    #657096

    Hey!

    You are welcome!
    For your information, you can take a look at Enfold documentation here – http://kriesi.at/documentation/enfold/
    And if there are features that you wish Enfold had, you can request them and vote the requested ones here – https://kriesi.at/support/enfold-feature-requests/
    For any other questions or issues, feel free to post them here on the forum and we will gladly try to help you :)

    Best regards,
    Yigit

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Shortcode Content Being Placed Out Of DOM Order’ is closed to new replies.