When I built this page layout hidden link I think the Views output was working differently - the names of the authors were displaying inline (i.e. as a raw Views output without the enclosing DIV) in the enclosing DIV in my page layout.
The author names are shown by embedding a separate view using a pivot table that contains a many-many relationship, but the View is now displaying with its own div ID. I can't seem to add classes to this DIV so I can display it inline, so now my formatting is completely thrown.
How can I set this up to show the View results inline again?
Thank you for contacting us here in the Support Forum
This is because since Views 1.1.11, the Views loop output is wrapped in some default HTML.
This HTML (div) will not allow to put Views Loop output inline with other content anymore.
Why this has been done?
To support new features of Views, such as infinite Scrolling as example.
Since Views was and is designed to create lists and displays of content, it is wrapping this content in HTML, to provide best support for all features.
What can you do to solve this?
You can apply a filter in your functions.php, which will remove this HTML wrapper and provide a "Results only" loop output.
Please acknowledge that it will also mean, features like:
- Pagination, specially AJAX pagination, will not work.
- Parametric search, specially AJAXed parametric search, will not work.
- Other future features will not work either (endless scroll, future feature "sort by" in the front end, etc)
What does the filter do:
- It hooks early in the View output.
- Priority 5 is mandatory as we already do some other cleaning at priority 10.
- It only affects a View with an ID of 375, adjust acordingly if needed!
- It only affects Views with actual results: if the View matches no result, the same “No items found” or whatever you have between the wpv-no-items-found shortcode applies.
- It returns only what is between the HTML comments <!– wpv-loop-start –> and <!– wpv-loop-end –> , excluding them. Only content between those HTML comments is returned, as is.
Thank you very much - that works perfectly! Will this work with a comma delineated list for multiple IDs? And what's the chance this can be built in as an option in a View's front end? Would make a big difference for cases like this application.
...and then, would it be possible at some point to add a tick box in the View front end (in advanced options, perhaps) to remove all the HTML without going this route of adding a filter to functions.php?