Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+1 vote
740 views
in Q2A Core by
I am trying to provide my users with direct access to the various profile section ( Profile page, Account settings page, Wall page, PM page, Favorites page) by giving a separate link menu from the sidebar of every page of the site.

But the Issue is my created link menu shown to everyone on site. I just want to show only to logged-in users to give them easy access.

is there any plugin available that shows widgets based on user level or any other solution that can archive my goal?
Q2A version: 1.8.5

1 Answer

+1 vote
by
selected by
 
Best answer

widget anywhere can solve your problem

https://github.com/svivian/q2a-widget-anywhere

but you have to change some

private function wa_output_widget($pos)
	{
		foreach ($this->wanyw_widgets as $widget) {
			if ($widget['position'] === $pos )
			{
				if ($widget['ordering'] == 1 && !qa_is_logged_in() )
				{					
					$this->output('');
				}
					else
				$this->output($widget['content']);
			}
		}
	}

add https://github.com/svivian/q2a-widget-anywhere/blob/master/qa-wa-layer.php#L67

with order ==1 only shown to members

by
Thanks sonsuz for your solution,

I am already using WidgetAnywhere plugin on my site, If i follow your solution so it means every widget i created using WidgetAnywhere plugin only shown to logged-in users.

How can i apply your solution to particular my link menu widget?
by
You can assign a number you use in the ordering for this job. for example, ordering 7 is for members only, 6 is for guests only.  i did for user, guest, points. you can change ordering numbers for a widget that you have not used before.
by
Great, It worked. Thanks @Sonsuz

How to show multiple WidgetAnywhere widgets to only logged in users? (Just want to learn coding tricks)
by
if ($widget['ordering'] == 7 && qa_is_logged_in() )

just little change
...