Skip Navigation

[Resolved] Created a tab Section a custom post type

This support ticket is created 5 years, 6 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.

Our next available supporter will start replying to tickets in about 7.83 hours from now. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9: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/Karachi (GMT+05:00)

This topic contains 3 replies, has 2 voices.

Last updated by leeB-6 5 years, 6 months ago.

Assisted by: Waqar.

Author
Posts
#1244378
Untitled.png

Tell us what you are trying to do?
I'm trying to create a tab section from a custom post type

Example of a tabbed section
hidden link

Is there any documentation that you are following?
None that I can find.

Is there a similar example that we can see?
Please see example image

What is the link to your site?
hidden link

#1245416

Hi,

So I've been working on the following code to get it working.

What is meant to happen:
hidden link

What Toolset is out putting:
hidden link

How do I remove the divs ie: #wpv-view-layout-6589-TCPID6438

How do I only put an option on the first one in the loop?

Ie:

<input type="radio" name="tabs" id="tab1" checked="checked">
then
<input type="radio" name="tabs" id="tab2" >

#1245603

Hi Lee,

Thanks for writing back.

>> How do I remove the divs ie: #wpv-view-layout-6589-TCPID6438

- On the view's edit screen, you'll find a checkbox "Disable the wrapping DIV around the View", just above the "Output Editor" section.
( example screenshot: hidden link )

Please check it and the view's wrapping div container will be removed.

>> How do I only put an option on the first one in the loop?

- To output some content only for the first item in the view's loop, you can use the shortcode "wpv-loop-index" ( ref: https://toolset.com/documentation/user-guides/views-shortcodes/#vf-1195331 ), in conditional code blocks ( ref: https://toolset.com/documentation/user-guides/conditional-html-output-in-views/using-shortcodes-in-conditions/ )

Example:


[wpv-conditional if="( '[wpv-loop-index]' eq '1' )"]
<input type="radio" name="tabs" id="tab[wpv-loop-index]" checked="checked">
[/wpv-conditional]
[wpv-conditional if="( '[wpv-loop-index]' ne '1' )"]
<input type="radio" name="tabs" id="tab[wpv-loop-index]" >
[/wpv-conditional]

I hope this helps and please let me know if you need any further assistance around this.

regards,
Waqar

#1256809

My issue is resolved now. Thank you!