Shortcode Position Problem
Hi there,
I'm using the latest versions of Brizy, Brizy Pro and Wordpress.
I'm trying to display custom content inside a brizy page with shortcode.
The problem is Brizy put this content out of the "brz-root__container".
In Brizy editor:

---
In Frontend

---
Output HTML source
Top highlighted line"<div>...</div>" should be in the middle highlighted line "<div></div>"

Mispositioned div contains this:
"<div><p>administrator<span class="edit"> Edit</span></p><p>Fejen<span class="show_edit_user_name"> Edit</span></p><form class="forms" id="edit_user_name" style=""><input type="text" id="display_name" name="display_name" value="Fejen"><br><input type="submit" class="update_button" user="1" value="Güncelle"></form><p>dev@fejen.com<span class="update_user_name"> Edit</span></p></div>"
Also there isn't any custom css to position or style this HTML content. The reason i'm not using embed element is the HTML content is created dynamicly in functions.php so the content is changing user by user.
Thank you for your effort and help.
-
Also,
in brizy editor shortcode position is none.
0 -
Hi,
is this a custom shortcode? Does it work well on a WordPress simple page or in another builder? Did you test another shortcode? Does it behave the same?
0 -
Hi Alex,
Yes it's custom shortcode and it is working well on WordPress simple pages.
Also as you ask, I have just tested a basic shortcode, just print 'hello' and the resault is same.
0 -
The thing is that it happens with custom-created shortcodes. I meant if you tested this with other shortcodes provided by a third-party plugin. eg "Contact Form 7" plugin that works with shortcodes. If it works well with other shortcodes then most likely it's because of the code.
0 -
Hi again Alex,
Thank you for your support. I'm sharing the solution for brizy users.
If you are printing any content on the screen with custom shortcode, use ob_start() and ob_get_clean() functions as described here:
https://stackoverflow.com/questions/23334359/wordpress-shortcodes-in-the-wrong-place
1 -
Hi,
thank you for sharing. This for sure will help others.
0
Please sign in to leave a comment.
Comments
6 comments