integrating the widget within a php function code
-
Hi,
I am using a php function which lets me restrict some parts of my posts to be visible only to the site members. In my post editor I put the restricted content between [member] and [/member] short codes and when a non-member visits the page, he sees a text instead of the restricted content which says “You need to be a member to see this part”.
I need to include the social login widget within that message which a non-member sees on the page. I don’t know how to do that.
I need a kind helping hand in this regard. Lots of thanks in advance.
The restricting php function that I use is as follows (I have included it in my theme’s function.php file):add_shortcode( 'member', 'member_check_shortcode' ); function member_check_shortcode( $atts, $content = null ) { if ( is_user_logged_in() && !is_null( $content ) && !is_feed() ) return do_shortcode($content); return '<div style="background-color: #DDEEFF; padding: 10px; border: 2px dotted navy"><h4 style="background-color: navy;padding: 0px;text-align: center"><b><font color="white">You need to be a member to see this part</font></b></h4></div>'; }
I need to show the social login widget in that message box which replaces restricted content. Thanks for your kind help in advance.
Best,
Omidhttps://www.ads-software.com/plugins/wordpress-social-login/
- The topic ‘integrating the widget within a php function code’ is closed to new replies.