Ian Butler
Forum Replies Created
Viewing 8 posts - 46 through 53 (of 53 total)
Viewing 8 posts - 46 through 53 (of 53 total)
I think you misunderstood.
As I’m not using geodir-home.php I did the following.
Page template created normal WP way then I copied the snippets of code I need from geodir-home.php to create a custom page
Okay on line 359 of geodirectory_widgets.php I have replaced with:
if (current_user_is(‘s2member_level1’)) { register_widget(‘geodir_loginwidget’); }
This works and now only shows the widget conditionally.
Can you foresee any problems with doing this?
Thanks
I suppose I could remove the widget completely from the BuddyPress pages and create a set of similar pages for business owners with the widget included, and make these restricted…. Just seems a cumbersome approach.
Let me know if you can think of a way I can avoid doing this.
Thanks again.
That is an option and it would stop certain users adding listings, however I’d rather not give the impression that it’s possible to add listings.
This might be annoying for the user.
I would much prefer to display the widget conditionally if this is possible.
Thanks Guust,
I can add page level restrictions just fine but need to apply some widget logic.
For example in geodir-location.php i can wrap the right sidebar hook in this code
if (current_user_is(‘s2member_level4’)) {
###### SIDEBAR ######
do_action(‘geodir_location_sidebar_right’); }
That of course will remove the entire right sidebar unless the logged in member is Level 4.
What I’m trying to do is conditionally display just the dashboard widget, not the entire sidebar.
Is there a file where I can add my code to achieve this?
Get the latest news, tips, and exclusive content directly in your inbox.
Confirm your email address, and instantly receive the discount code :)