Skip Navigation

[Resolved] Slider displaying on all archive pages instead of just hompage

This support ticket is created 5 years, 10 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
- 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 5 replies, has 2 voices.

Last updated by Waqar 5 years, 10 months ago.

Assisted by: Waqar.

Author
Posts
#1181763

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!

#1182190

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

#1182665

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

#1183418

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

#1183675

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

#1184247

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