Answer the question
In order to leave comments, you need to log in
How to use wordpress conditional logic to display a script on all pages except for two specific ones?
Actually, everything was written in the question. There are a lot of pages, headings, categories. For specific categories, certain scripts are needed, which at the same time should not intersect with a common script that is suitable for all other pages ...
As I understand it, are there any priorities? Like if you're on a landing page, then the general ones don't apply anymore?
Answer the question
In order to leave comments, you need to log in
You yourself answered your own question))) With the help of conditional logic.
Using conditional logic. But! If you need to include a script on all pages, except for two specific ones, then instead of listing all the pages where they are needed, it is better to list those pages where they are not needed with "negation".
if(!is_page(array(5,6))):
// подключаем скрипты и стили
endif;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question