• the page automatically display a number inside a div called wpb_wrapper, when I use a custom shortcode. but its nowhere in my function. When I delete the shortcode the number goes away.

    <div class="wpb_text_column wpb_content_element " >
        <div class="wpb_wrapper">
            1
    
        </div>
    </div>

    Any clues?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Could you post your shortcode code? The issue probably lies in there. Additionally, if you’re echoing or printing any content, when using a shortcode all content should be returned instead.

    Thread Starter daniel2323

    (@daniel2323)

    function millennium_grid(){
    return include(“mg-custom-grid.php”);
    }
    add_shortcode(‘millennium’, ‘millennium_grid’);

    The include() function is probably returning true that the file exists and can be included while the content of the include file are trying to print. Instead, wrap the include around some output buffering and return the result:

    function millennium_grid(){
    	ob_start();
    		include( 'mg-custom-grid.php' );
    	return ob_get_clean();
    }
    add_shortcode('millennium', 'millennium_grid');
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘A number appears inside a div called wpb_wrapper, when I use a custom shortcode’ is closed to new replies.