[Resolved] Can I remove the DIV that is wrapped around VIEWS
This support ticket is created 7 years, 3 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.
No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.
I'm trying the create a grid based upon different views, but the div's wrapped around the views output do interfere...
Let me explain the issue and approach.
I do have 9 different Custom Post Types
All those Custom post types share the same Custom Taxonomy.
Per Taxonomy entry i'm creating an overview grid with links to Custom Post Type Archives
Lets say the Taxonomy is called "Sector" and contains the items [Tourism / Agri / Logistic ]
Then i'm creating a grid for Tourism, a grid for Agri and a grif for Logistic.
This grid displays Links to the Custom Post Tope Archives. But i only want a Link to a CPT archive if there is at least one entry for the selected Taxonomy.
e.g.: Sector->Tourism
Only CPT1, CPT2 and CPT5 comtain a post with the tourism sector checked.
Then I only want a link the the archives of CPT1, CPT2 and CPT5
Per CPT i'm using a view to check if there are posts based upon the taxonomy using a views parameter.
Everything works, only the problem is that every view is wrapped in a DIV. I only want to output a link when there is at least one item. The other views should not output anything.
is this possible... removing the wrapper Div of the views?
Hi Shane,
first of all, thank you for your quick response.
This solution seems to be working partly. Views that do contain results, are being stripped clean.
But views that do result in no items found are still being wrapped in divs.
What would be the best solution?
It would be great in one of the future releases of views to have the option to enable / disable this wrapper on a view basis with a checkbox or radiobutton.
Added an ELSE statement when $start variable or the strrpos() function returns false.
There I reused the same code but checkking on content between <!-- wpv-no-items-start --> and <!-- wpv-no-items-end --> in my no results section of the Views.
Guess this will be sufficient for my use... but i'm wondering why this isnt an option in Views as a selector. And why is Views standard outputting the Div? Is there a certain reason?