WordPress Divi Theme shortcode adding problem
My Divi version is 3.20.1. I am trying to add my own custom shortcode in the website. However, when I add this shortcode, the elements displayed using this shortcode appear both in the “Edit page” area top section besides the main page.
add_shortcode( "Btx_Show_Testimonial_Main_Page", 'lantry_btx_fun_Main_Page_Show_Testimonial');
function lantry_btx_fun_Main_Page_Show_Testimonial(){
include_once LANTRY_BITECHX_SHORTCODE_DIR_PATH."views/Main_Page_testimonial_show.php";
}
My question is, how can I remove this from the “Edit page” section ??
I provided some screenshot.
Divi module Image Option Select
Show top of the post page
When I remove Divi this problem will be solved. But I need to use Divi.
3
Answers
You can check if a adminuser is logged in and if not execute your function hope this helps but now you have to always log out or use incognito mode to see if its there:
I don’t think the problem comes from DIVI but from your shortcode. Please attach the content of your file
Main_Page_testimonial_show.php
The shortcode callback shouldn’t produce an output but should return the result.
You can find this on documentation website here. Please pay attention to
Here, simply you can create the shortcode in the functions.php file and on your Page/Posts you can use the Text Module and add the [shortcode].