Hi,
I used layouts and views to create a slider, however, it is displaying on ALL archive pages (e.g. page 1, 2, 3, 4 etc) instead of JUST the homepage (page 1).
How do I get the slider to display *ONLY* on the homepage?
Thanks!
Hi there,
Thank you for contacting us and I'll be happy to assist.
I've checked your website's home page and a few archive pages, but the slider is only showing on the home page. Looks like you've managed to make this work, after writing to us.
For future reference, to show some content from the layout only on the homepage, you can duplicate the existing layout and restrict one of the layouts only for the homepage and other for the rest of the archive pages.
( ref: https://toolset.com/documentation/user-guides/custom-archives/ )
I hope this helps.
regards,
Waqar
Hi Waqar,
Unfortunately the issue still exists. If you visit page 2, 3, 4 etc you can see that the slider still appears on each page of the 'homepage'.
>For future reference, to show some content from the layout only on the homepage, you can duplicate the existing layout and restrict one of the layouts only for the homepage and other for the rest of the archive pages.
( ref: https://toolset.com/documentation/user-guides/custom-archives/ )
Unfortunately this method doesn't work as it still doesn't 'restrict' the slider from displaying on the subsequent pages of the homepage/blog layout (e.g. website.com/page/2).
Any ideas around this problem?
Thanks
Hi,
Thank you for clarifying that.
To hide the first (slider) block from the homepage's subsequent pages (e.g. /page/2/, /page/3/ etc), you can use body class "paged" in custom CSS code:
.home.blog.paged .content-sidebar-wrap .content .container-fluid:first-of-type {
display: none !important;
}
The above code will make sure that the slider is shown only on the first page of the homepage.
regards,
Waqar
Waqar,
Thanks for the update.
I tried putting that css custom code in the "layouts css and js" section and the loop editor and template css sections in the layout's view, but none of these worked - the slider remains on all subsequent pages of the homepage.
Just to clarify, where should I enter the css code you provided?
Thanks
Hi,
The code should work from "layouts css and js" section and/or loop editor's "CSS editors" tab, but I'm not seeing it getting included in the page's markup.
Can you please add it at WP Admin -> Appearance -> Customize -> Additional CSS and then test again, after clearing all involved caches?
In case the issue still persists, I'll need temporary access to the website's admin area for further troubleshooting.
I've set the next reply as private so that you can share the username and password for the admin account privately.
regards,
Waqar