Tips and Tricks HQ Support Portal › Forums › WP eMember › WP eMember Troubleshooting › Conflict with shortcodes of my theme
Tagged: shortcodes
- This topic has 7 replies, 3 voices, and was last updated 13 years, 4 months ago by blatternet.
-
AuthorPosts
-
July 7, 2011 at 5:21 am #3738blatternetMember
Hi there,
I use the Striking Theme (http://themeforest.net/item/striking-premium-corporate-portfolio-wp-theme/128763).
Striking offers a lot of shortcodes. For example with [info] blablabla [/info] it will draw a nice blue box.
Now the problem with eMember:
If I’m using some shortcodes of Striking they are not displayed:
[emember_protected] Here’s a litte introduction. [info] And a special info. [/info] [/emember_protected]
The content is protected but there is no blue info-box. The shortcode itself is also displayed.
I think it’s more a problem of the theme because I have the same problem with other plugins I tested. But perhaps you have a solution anyway.
Regards,
Ivan
July 7, 2011 at 6:56 am #34044amin007ParticipantYou are referring to shortcode nesting. Shortcode nesting will only work if they are created using the proper WordPress shortcode API. Please contact your theme developer to upgrade the shortcode so it uses the WordPress shortcode API (many developer implement shortcodes using a filtering technique which maybe the source of this issue).
July 7, 2011 at 12:11 pm #34045blatternetMemberThank you for your answer. I forwared your answer to the theme developer!
July 12, 2011 at 6:32 am #34046rentoMemberHi there,
I have problem running my custom shortcode within [emember_protected] shortcode. It is created using proper WordPress shortcode API and not filtering technique. Any ideas what might be the problem?
Shortcode is very simple:
function signature_shortcode( $atts, $content = null ) {
return ‘<span class=”signature”>’ . $content . ‘</span>’;
}
add_shortcode(‘sign’, ‘signature_shortcode’);
July 12, 2011 at 11:55 pm #34047amin007ParticipantLets try changing the priority of the shortcode filtering order. Please open the “wp_eMember1.php” file and search for the following line of code:
add_filter('the_content', 'do_shortcode',11);
Once you find it please change it to the following:
add_filter('the_content', 'do_shortcode');
Let me know if that helps.
July 13, 2011 at 8:29 pm #34048rentoMemberYes, this way it worked as well. But I got it working by replacing all “return $contents;” with “return do_shortcode($contents);” in protected tag function between lines 792 and 864 in wp_eMember1.php file. Your fix of course is better.
Thanks!
July 14, 2011 at 12:59 am #34049amin007ParticipantWordPress’s recommended shortcode filtering priority is 11. So if all the plugins specify 11 as the shortcode filtering priority then we will never see this issue. In your installation this is not the case which is why lowering the priority works.
July 14, 2011 at 4:59 am #34050blatternetMemberWow, your tipp, Amin, worked also with my issue! Pretty cool, thank you!
-
AuthorPosts
- You must be logged in to reply to this topic.