Skip Navigation

[Resolved] Display related view in a sidebar

This support ticket is created 5 years, 4 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 1 reply, has 2 voices.

Last updated by Minesh 5 years, 4 months ago.

Assisted by: Minesh.

Author
Posts
#1349999
B.PNG
A.PNG

Hi I was wondering if it was possible to show a related view or content template in the sidebar of a custom post by category.

I have a custom post called Technical Articles. I have created a custom taxonomy for Technical Articles called Article Type. Technical Articles can be categorized as either Article type A or B (or both)

The Technical Article posts have a widget added to their sidebar through Appearance > widgets

I want to show an advert (basic HTML with a link) in the sidebar (which I thought I could maybe create using a view or custom post type) but show a different one depending on what category has been selected

So if a Technical Article has been tagged with Type A it shows advert A in the Article Post type sidebar
If a Technical has been tagged with Type B it shows advert B in the Article Post type sidebar
If a Technical Article has been tagged both type A and B it shows both adverts.

I feel like this is relatively simple to do in a view (you just need to set up the view to show which category has been selected) but what I'm less sure about is how you would do that in a sidebar as it is not part of the post)

Is this possible?

#1350049

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Views offers [wpv-conditional] shortcode which you can use to display conditional ads based on term A or B or both assigned.
=> https://toolset.com/documentation/user-guides/conditional-html-output-in-views/displaying-taxonomies-conditionally/#specific