PriMoThemes — now s2Member® (official notice)

This is now a very OLD forum system. It's in READ-ONLY mode.
All community interaction now occurs at WP Sharks™. See: new forums @ WP Sharks™

spaces on shortcodes?

s2Member Plugin. A Membership plugin for WordPress®.

spaces on shortcodes?

Postby s2pidkaspr » August 20th, 2011, 2:08 pm

Hello,

i'm using s2member on my site. And the php conditionals works fine and so does the shortcodes. But, whenever I put two shortcodes, there is always some big space gap (where the shortcode is there).

For example I write this:

[s2If current_user_can(access_s2member_level1)]
Some content for Members who are logged in with an s2Member Level >= 1.
[/s2If]
[s2If !current_user_can(access_s2member_level1)]
Some public content.
[/s2If]

Those members who are with s2member accounts will NOT see the "Some public content" area. But rather see a big white space as if the shortcode is supposed in there.

While those area for public will NOT see the "Some content for Members" area. But rather see a big white space as if the shortcode is supposed in there.

PHP conditionals is not doing this. If the content is not visible for that user, they won't see a big white space in there. So, i'm wondering, why shortcode is doing this? Anyway to fix this? Thanks
User avatar
s2pidkaspr
Registered User
Registered User
 
Posts: 48
Joined: August 6, 2011

Re: spaces on shortcodes?

Postby Cristián Lávaque » August 20th, 2011, 8:58 pm

If that's the case, then it'd be a problem with the way WordPress parses the shortcodes. Does it still leave the big empty space if you put the shortcodes one right next to the other?

Code: Select all
[s2If current_user_can(access_s2member_level1)]
Some content for Members who are logged in with an s2Member Level >= 1.
[/s2If][s2If !current_user_can(access_s2member_level1)]
Some public content.
[/s2If]
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010

Re: spaces on shortcodes?

Postby s2pidkaspr » August 21st, 2011, 12:14 am

Cristián Lávaque wrote:If that's the case, then it'd be a problem with the way WordPress parses the shortcodes. Does it still leave the big empty space if you put the shortcodes one right next to the other?

Code: Select all
[s2If current_user_can(access_s2member_level1)]
Some content for Members who are logged in with an s2Member Level >= 1.
[/s2If][s2If !current_user_can(access_s2member_level1)]
Some public content.
[/s2If]


hmmm...weird...when i do that, only the content for members are triggered, and the public content is showing

[s2If !current_user_can(access_s2member_level1)]
Some public content.
[/s2If]

Just like that on the site. Meaning to say, it doesn't do the coding. But when i put it down just like before:

[s2If current_user_can(access_s2member_level1)]
Some content for Members who are logged in with an s2Member Level >= 1.
[/s2If]
[s2If !current_user_can(access_s2member_level1)]
Some public content.
[/s2If]

Both code works but just like I said, it will have some big spaces in there when it shouldn't be.
User avatar
s2pidkaspr
Registered User
Registered User
 
Posts: 48
Joined: August 6, 2011

Re: spaces on shortcodes?

Postby s2pidkaspr » August 22nd, 2011, 12:27 am

Hmm. I thought I had new reply here. So any ideas?
User avatar
s2pidkaspr
Registered User
Registered User
 
Posts: 48
Joined: August 6, 2011

Re: spaces on shortcodes?

Postby Cristián Lávaque » August 22nd, 2011, 10:36 pm

I guess it's a WP shortcode parsing problem, sorry. :|

You can use PHP instead, then.
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010

Re: spaces on shortcodes?

Postby s2pidkaspr » August 22nd, 2011, 11:17 pm

But I cant use php on that page i'm trying to put shortcodes on. Or is it suggested to use a plugin that allows php on post and use s2member's php code on post's instead of shortcode? Would that be fine? Would it conflict or anything?
User avatar
s2pidkaspr
Registered User
Registered User
 
Posts: 48
Joined: August 6, 2011

Re: spaces on shortcodes?

Postby Cristián Lávaque » August 23rd, 2011, 2:36 am

That'd be fine. You can use https://wordpress.org/extend/plugins/exec-php/ Just remember to stick to the HTML editor when you use PHP, don't open the Visual editor or it'll mess up your code.
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010

Re: spaces on shortcodes?

Postby s2pidkaspr » August 25th, 2011, 11:45 pm

Now that works like a charm. Thanks. It doesn't have any spaces now. That plugin really did the trick. Thanks again. ;)
User avatar
s2pidkaspr
Registered User
Registered User
 
Posts: 48
Joined: August 6, 2011

Re: spaces on shortcodes?

Postby Cristián Lávaque » August 26th, 2011, 10:37 pm

:)
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010


Return to s2Member Plugin

Who is online

Users browsing this forum: No registered users and 3 guests

cron