Back to Top

Solution: Shortcode move to top of content issue

Solution: Shortcode move to top of content issue

Recently I was working with one of application and I have created shortcode for some functionality and I want to display shortcode data after the content of posts so I have place shortcode after the post content from admin editor.

But in frontend, shortcode data was displaying in top of content even I put shortcode anywhere in editor, It displays top of page so today I am going to share how I solve issue of it

You should check out this ShortCode in WordPress to learn everything about Shortcode in WordPress with examples

I have used ob_start and ob_get_clean function to clear the buffer and it starts working. That will return the content rather than echo it directly and that you have to do in the case of a WordPress shortcode

Solution

This works for me like a charm. Hopefully works for you also. Please share this article if this works for you.Solution: Shortcode moves to the top of the content issue.

You may also like:

Programmatically Insert Content in WordPress
SSL with WordPress
Create Own Widget in WordPress

Leave a Reply

Your email address will not be published. Required fields are marked *

Most Popular Posts

Event Delegation in jQuery

Posted on 2 years ago

Bhumi

The Readers’ Poll – July 2013

Posted on 4 years ago

Bhumi

How to set Module Position in Joomla

Posted on 5 years ago

Bhumi

How to Use HTML5 Data Attributes

Posted on 2 years ago

Bhumi

Overview of ECMAScript 6 new Features

Updated 18 years ago

Bhumi

Getting started with Amazon Web Services

Updated 18 years ago

Bhumi

Facade implementation in Laravel

Updated 18 years ago

Bhumi

The Reader’s Poll – June 2015

Posted on 2 years ago

Bhumi

The Reader’s Poll – August 2014

Posted on 3 years ago

Bhumi

The Reader’s Poll – June 2014

Posted on 3 years ago

Bhumi

The Readers’ Poll – May 2014

Posted on 3 years ago

Bhumi

The Readers’ Poll – August 2013

Posted on 4 years ago

Bhumi