Do not load newspaper css on homepage

Posted in: Newspaper
Post count: 16

Hi guys,

I’ve created an new homepage with Thrive landingpage software. So i would like to not get all the newspaper stuff loaded on this page (and other landing pages) since these will not be used.

How can i get this done?

Thanks,
Ronny

Post count: 22421

Unfortunately you will still need css. As css is loaded for the entire site at once. It is not loading just the used elements. For the moment you will still need the entire theme css file. You built a page in a custom page builder, but what about headers footers, other parts of the site excluding the page itself. The layout will break most likely.
Thanks.

Post count: 16

Hi Bogdan,

Thanks for the reply.

Just for clarification. I created a complete page including header, footer etc. So the complete page is built with an custom editor. There are no components of the newspaper theme used in this landingpage. That is why i want to remove the css etc.

Hope to hear from you soon.

Thanks
ronny

Post count: 22421

Ok,

In this case you will need a bit of coding skills to do it. This should help:
https://wordpress.stackexchange.com/questions/217881/remove-css-styles-from-specific-page

Thank you!

Post count: 22421

Ok,

In this case you will need a bit of coding skills to do it. This should help:
https://wordpress.stackexchange.com/questions/217881/remove-css-styles-from-specific-page

Thank you!

Post count: 16

oke thanks bogdan!

Post count: 16

One last question bogdan.

Which are the style names i should use? I tried the following but those don’t work:
function remove_scripts() {

if ( is_page( ‘slug-name’ ) ) {

// Remove Styles
wp_dequeue_style( ‘td-theme’ );
wp_deregister_style( ‘td-theme’ );
wp_dequeue_style( ‘td-theme-woo’ );
wp_deregister_style( ‘td-theme-woo’ );
}
}

Thanks!

Post count: 22421

Hello,

The styles loaded should be seen when viewing your page source.right click on your site and click the view source button. Then look for ‘.css’ and see which ones you want to remove.

Thank you!

Post count: 16

Thanks Bogdan.

The problem was the priority. I had the priority at 99 but it should be bumped up higher than 1001.

add_action( ‘wp_enqueue_scripts’, ” , 1100);

This did the trick.

Thanks for the help!

You can close this ticket.

Kind regards,
Ronny

Post count: 22421

Glad you found the issue.
Have a great weekend!

Viewing 10 posts - 1 through 10 (of 10 total)
The forum ‘Newspaper’ is closed to new topics and replies.