A
A
Alexander Osadchy2020-06-18 08:36:07
WordPress
Alexander Osadchy, 2020-06-18 08:36:07

Is it possible in WP through If \ else to hide parts of the code for < 768 or > 768 - in media?

Hello!

Can something like this be done?

That is, I have a piece of html that I would like to hide not with styles, but generally remove it with @media (max-width: 768px) - is it possible with wp tools?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
RTFMaster, 2020-06-18
@DELUX

If only using js to calculate the width of the window, if it fulfills the condition, take the block (container) you need from the DOM, remember its parent, cache it in the buffer (if it needs to be restored) or delete it, and "cut" it from the DOM (HTML page) .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question