Hi @chilibird,
Please add the following code in your theme’s functions.php and let me know if it fixes the issue.
function shortcode_empty_paragraph_fix( $content ) {
// define your shortcodes to filter, '' filters all shortcodes
$shortcodes = array( 'Modula' );
foreach ( $shortcodes as $shortcode ) {
$array = array (
'<p>[' . $shortcode => '[' .$shortcode,
'<p>[/' . $shortcode => '[/' .$shortcode,
$shortcode . ']</p>' => $shortcode . ']',
$shortcode . ']<br />' => $shortcode . ']'
);
$content = strtr( $content, $array );
}
return $content;
}
add_filter( 'the_content', 'shortcode_empty_paragraph_fix' );
All the best,
Mihaela
Moderator
Jan Dembowski
(@jdembowski)
Forum Moderator and Brute Squad
Mihaela, can you please walk the user how to make a plugin for that?
Editing themes often ends poorly.
Jan, thank you!
I have created a plugin for you @chilibird.
Please download it from the link below, install and activate it:
https://www.dropbox.com/s/8nwntkpcmjgqyk9/wp-modula-shortcode-fix.zip?dl=0
Best regards,
Mihaela
Hi,
I try the code directly in function.php and by plugin version and don´t work at all.
http://www.lomboser.pt/portfolio-item/solintellys/
Any solution?
Hi @lomboser,
I have checked your website and there are no duplicate images on my end – so the code worked.
Please check as well and let me know.
All the best,
Mihaela
-
This reply was modified 8 years, 9 months ago by
Miha.
I have the same problem on my website:
https://mypersonaljungle.it/2017/11/21/pothos-pianta-da-appartamento/
both solutions failed to solve the problem…
Please let me know how can I fix this problem
thanks