ycliper

Популярное

Музыка Кино и Анимация Автомобили Животные Спорт Путешествия Игры Юмор

Интересные видео

2025 Сериалы Трейлеры Новости Как сделать Видеоуроки Diy своими руками

Топ запросов

смотреть а4 schoolboy runaway турецкий сериал смотреть мультфильмы эдисон
Скачать

Where To Add Custom Code In Divi (CSS, Javascript & PHP)

Автор: Pee-Aye Creative

Загружено: 2020-04-14

Просмотров: 23094

Описание: In this handy guide you will learn exactly where to add custom code like CSS, Javascrip, Jquery, and PHP in your Divi Theme.

View Full Blog Post: https://bit.ly/DiviCode

Are you wondering where to put those awesome code snippets in Divi? A lot of my tutorials give away a free snippet of CSS, Javascript, Jquery, or PHP. I have found myself repeatedly explaining where to put each snippet, so I thought it would be good to have one centralized article to reference. This guide will help you know where to add custom code in Divi, and I'll also show you the CSS hierarchy as well.

CSS Hierachy (Specificity) In Divi
Before we dive in, let's talk quickly about CSS hierarchy, otherswise know and specificity.

Basically, if you target something with CSS, and there are two or more conflicting CSS rules somewhere on the website that point to the same element, the CSS in certain locations will override the others. It has more power the higher up in hierarchy it is. The browser would get confused otherwise, and needs to follows some rules to determine which one is most specific and therefore which one wins out.

The level of specificity depends where the code is placed in Divi. It would not be very helpful to show you where to add custom code in Divi without showing you why. Here's a list of the CSS hierarchy in Divi, with 1 having the most power and 8 the least:

1. Inline Styles
2. Advanced Tab
3. Code Module
4. Page Settings
5. Theme Options
6. Child Theme
7. Theme Customizer
8. Divi Parent Theme

If your head is spinning in confusion, don't worry. It will make more sense as we go and as you gain hands-on experience, and you will soon understand clearly what each of these are and when to use them.

#1. Inline Styles
Code Languages: CSS, HTML
Inline styles are those that are written directly in the html structure of the page or post. Inline styles have the most importance in code. However, even though these are the most powerful, they should be used only for small, simple changes.

#2. Advanced Tab
Code Languages: CSS
Another form of inline styles, although not as obvious as "inline", is in the Advance tab of any section, row, column, or module. Each have different boxes, and some have quite a lot which are very helpful.

#3. Code Module
Code Languages: CSS, HTML, Javascript
Another option for adding CSS and Javascript is the Divi Code Module., which is perfect for integrating code such as iframes, embed codes, shortcodes, and more.

#4. Page Settings Custom CSS
Code Languages: CSS
My favorite places to add temporary custom code is the in the page settings Advanced tab Custom CSS area. It creates "live view" of the code as you work and edit. Just remember this is temporary, and you should copy and paste this code into your child theme stylesheet or Theme Options custom CSS box when you are done.

#5. Theme Options
Code Languages: CSS, Javascript
The next place to add custom code that affects the entire site at once is the Divi Theme Options. There are several places to add code here at different places.

Custom CSS
You probably have noticed by now that almost every tutorial I write, I mentioned adding the code snippets to the Divi Theme Options Custom CSS box. I say this because it is the easiest and most practical place to add custom CSS, especially for beginners who may not have a Divi child theme.

Javascript (And Jquery)
There's also a handy place in the Theme Options for other types of code, and that is in the Integrations tab. Here you can add code that affects the head or body of the site, similar to a child theme or parent theme. This first box is the perfect place to add all the Javascript and Jquery snippets we give out.

#6. Child Theme
Code Languages: CSS, Javascript, PHP
If you have a child theme installed and active, then I actually recommend putting it there instead. This is the ultimate place to add any time of custom code in Divi.

Custom CSS
I recommend moving all of your custom CSS to the Divi child theme style.css file whenever your site is completed and you are ready to go live.

Custom PHP
Any custom PHP snippets should be placed in the Divi child theme functions.php file. Some of our tutorials have PHP snippets, and this is where you should put it.

#7. Theme Customizer
Code Languages: CSS
You can also add custom css to the Theme Customizer. You can access this either from Appearance Customize in the backed, or from hovering over yoru website name in the top left corner on the frontend.

#8. Divi Theme
Code Languages: Pretty Much Anything
Last on the list is Divi. This is the worst place to add any kind of custom CSS. Don't do it. If you did, it would be erased and overwritten as soon as Divi has an update. As far as hierarchy goes, this is the weakest place to add custom CSS.

Join The Divi Teacher Facebook group:   / thediviteacher  
Visit our Divi child themes, plugins, tutorials, and courses here: https://www.peeayecreative.com/

Не удается загрузить Youtube-плеер. Проверьте блокировку Youtube в вашей сети.
Повторяем попытку...
Where To Add Custom Code In Divi (CSS, Javascript & PHP)

Поделиться в:

Доступные форматы для скачивания:

Скачать видео

  • Информация по загрузке:

Скачать аудио

Похожие видео

Как использовать пользовательские адаптивные медиа-запросы CSS в Divi

Как использовать пользовательские адаптивные медиа-запросы CSS в Divi

Как автоматически предотвратить перекрытие страницы фиксированным заголовком Divi и сместить его ...

Как автоматически предотвратить перекрытие страницы фиксированным заголовком Divi и сместить его ...

Как превратить таблицу Excel в работающий веб-сайт (бесплатно и быстро)

Как превратить таблицу Excel в работающий веб-сайт (бесплатно и быстро)

Deep House Mix 2024 | Deep House, Vocal House, Nu Disco, Chillout Mix by Diamond #3

Deep House Mix 2024 | Deep House, Vocal House, Nu Disco, Chillout Mix by Diamond #3

Сисадмины больше не нужны? Gemini настраивает Linux сервер и устанавливает cтек N8N. ЭТО ЗАКОННО?

Сисадмины больше не нужны? Gemini настраивает Linux сервер и устанавливает cтек N8N. ЭТО ЗАКОННО?

SHAZAM Top 50🏖️Лучшая Музыка 2025🏖️Зарубежные песни Хиты🏖️Популярные Песни Слушать Бесплатно #40

SHAZAM Top 50🏖️Лучшая Музыка 2025🏖️Зарубежные песни Хиты🏖️Популярные Песни Слушать Бесплатно #40

Учебник по React для начинающих

Учебник по React для начинающих

How to Create a Responsive Transparent Menu Header with Divi Builder - Step by Step Tutorial

How to Create a Responsive Transparent Menu Header with Divi Builder - Step by Step Tutorial

How to Create a Dynamic 3D Mousemove Animation Effect in Divi

How to Create a Dynamic 3D Mousemove Animation Effect in Divi

ПЕРЕСТАНЬ ПЛАТИТЬ за Cursor AI. Используй эту БЕСПЛАТНУЮ и ЛОКАЛЬНУЮ альтернативу | VSCode+Roo Code

ПЕРЕСТАНЬ ПЛАТИТЬ за Cursor AI. Используй эту БЕСПЛАТНУЮ и ЛОКАЛЬНУЮ альтернативу | VSCode+Roo Code

How To Create A Reusable Divi Site Template For New Installs Using Divi Assistant

How To Create A Reusable Divi Site Template For New Installs Using Divi Assistant

Музыка для работы - Deep Focus Mix для программирования, кодирования

Музыка для работы - Deep Focus Mix для программирования, кодирования

Обзор всех модулей Divi, включая CSS-трюки — Часть 1

Обзор всех модулей Divi, включая CSS-трюки — Часть 1

Вся IT-база в ОДНОМ видео: Память, Процессор, Код

Вся IT-база в ОДНОМ видео: Память, Процессор, Код

How To Create A Divi Mega Menu (Without Plugins)

How To Create A Divi Mega Menu (Without Plugins)

Переговоры в Женеве, НАТО успокаивает Трампа, Адама выписали. Мартынов, Чижов, Низовцев, Асланян

Переговоры в Женеве, НАТО успокаивает Трампа, Адама выписали. Мартынов, Чижов, Низовцев, Асланян

Расположите кнопки рядом друг с другом в одном ряду // Учебник Divi

Расположите кнопки рядом друг с другом в одном ряду // Учебник Divi

Микросервисы на практике - сервис продажи билетов

Микросервисы на практике - сервис продажи билетов

Что такое Rest API (http)? Soap? GraphQL? Websockets? RPC (gRPC, tRPC). Клиент - сервер. Вся теория

Что такое Rest API (http)? Soap? GraphQL? Websockets? RPC (gRPC, tRPC). Клиент - сервер. Вся теория

Как изменить количество столбцов в модуле блога Divi (очень просто, всего одна строка кода!!!)

Как изменить количество столбцов в модуле блога Divi (очень просто, всего одна строка кода!!!)

© 2025 ycliper. Все права защищены.



  • Контакты
  • О нас
  • Политика конфиденциальности



Контакты для правообладателей: [email protected]