Hi,
I add a “Text with Header” element via tdComposer.
I have created a shortcode [foobar] in functions.php of the child theme.
I add [foobar] in the text field and the content of the shortcode shows just fine.
I save the page using tdComposer.
When I try to edit the page agin with tdComposer I get the following error:
Errors at columns: 2(models) : 8(dom). The model does not match the content
Help, please?
Hi,
What if you add it in a column text element, or use a different shortcode? Could be caused by an issue that was solved a few updates ago, concerning shortcodes.
There was a temporary fix provided at the time – https://forum.tagdiv.com/topic/shortcode-in-text-element-convertered-to-html/
The fix was implemented in the theme is update 9.2 I believe. I could give it a try on my end if you can provide the function to create the shortcode, to see if it happens in the latest theme version.
Thanks
Hi Simion,
Thanks for the feedback.
Changing the shortcode to the following:
add_shortcode( 'foobar', 'foobart_func' );
function foobar_func($atts) {
ob_start();
echo "Testing the shortcode!!!";
$var = ob_get_contents();
ob_end_clean();
return $var;
}
seems to solve the problem.
That means there is some thing wrong with my real shortcode.
The thing is that the real (original) shortcode shows and functions perfectly on the home page and, if open functions.php via theme editor and make a small change, like an
extra space, it saves the file without errors.
Would you like to send you the admin creds at your email to give it a glance?
Thank you in advance.
-
This reply was modified 7 years by
lazdim.
Hi,
Maybe double check the code used to create the shortcode, could be a problem there. if it works in one page it should work in the others as well. Check some guides for example
– https://torquemag.io/2017/06/custom-shortcode/
– https://wpshout.com/how-to-create-wordpress-shortcodes/
Maybe even make some tests with a plugin – https://alienwp.com/shortcodes-wordpress/
I don’t have much experience with adding and using shortcodes, if you follow the basic implementation of them they should work properly. Also note the issue I mentioned above which happened in older theme versions.
Thanks
Hi Simion,
Thanks for the references.
The thing is that the shortcode works as it should but it conflicts with tagDivComposer.
When I remove it, tagDivComposer works fine. If I add it again, I get the “Errors at columns: 2(models) : 8(dom). The model does not match the content” error when I open the taDiv Composer.
I read your references and I can’t see something I did wrong. The shortcode is developed as it should.
I have the previous theme’s version. I will make the update and I will let you know if the problem remains.
-
This reply was modified 7 years by
lazdim.