Support » Plugin: Code Snippets » fresh install – order of elements (shortcode is displayed above other elements)

  • Resolved yurone


    hi !

    thanks for providing this plugin !
    it seems like what i need, however i have strange issue…

    i put [shortcode_name] between my html, but it appears above !

    example, i put in html editor:


    but in front of the site i see in this order:

    i tried with your shortcodes and tried to create mine… same problem.


Viewing 10 replies - 1 through 10 (of 10 total)
  • i use this theme and i tested both in Pages and Posts mode.

    if you want to try it here is download

    p.s. i emptied cache but didn’t help

    i tried on another theme and exactly the same problem.
    order of elements is not respected… snippets is first to display

    in the screenshots i provided above i made tests with default sample snippets.

    when i test with my snippets shortcodes (they display image + onclick action)
    also i noticed that in the “admin” edit of this page i see my images on top of EDITOR which is obviously also a bug.

    i tried another plugin on same environment and it worked fine.
    i use WordPress 5.0.3–en_US au

    let me know when you fix it and i will tray again πŸ™‚

    Plugin Author Shea Bunge


    Hi yurone,

    Thank you for reporting this. It looks like there’s a bit of an issue with my example shortcode snippet. Shortcode callbacks should not echo content, but should always return it.

    Here’s one example of how you could fix that snippet:

    add_shortcode( 'shortcode_name', function () { 
    	return '<p>write your HTML shortcode content here</p>';
    } );

    Otherwise, if you would prefer to write direct HTML code and not have to worry about PHP strings, you can use output buffering like this:

    add_shortcode( 'shortcode_name', function () {
    	ob_start(); ?>
    	<p>write your HTML shortcode content here</p>
    	return ob_get_clean();
    } );

    it worked πŸ™‚
    i suppose you need to update plugin now

    thx, cool plugin and fast support

    Hi @bungeshea,

    Was this fixed in the most recent release of Code Snippets, which came out after this thread was posted?

    Doesn’t look like it, but wanted to be double-check or see why not.

    Thanks for a great plugin!

    It looks like this issue was also touched upon a couple years ago here:

    So, a bit puzzled.

    Thanks again.

    Plugin Author Shea Bunge


    Hi @roam92,

    The issue is one that should be fixed in individual sites, not in the plugin itself. Updates to the plugin only fixes the default sample snippets which are installed on new sites.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘fresh install – order of elements (shortcode is displayed above other elements)’ is closed to new replies.