P
P
Parrot2232021-07-24 15:11:50
PHP
Parrot223, 2021-07-24 15:11:50

How to set conditions for the button to appear on the page?

There are product cards, the task is to make the button appear when text appears in the wp custom field. Actually, it is displayed (code below). But at a certain screen resolution, you need to cancel this condition/rule and make the button appear everywhere, regardless of whether the field is filled in. Let's say I feed php the screen resolution from js, but firstly, how to combine it all, and secondly, how to reassign the condition and specify the display everywhere?

<?php
      if(!empty($row['equip_cards_about_hidden'])) {
             ?>
                 <button class="about-item-btn-hidden">
                       <svg width="52" height="52" viewBox="0 0 52 52" fill="none" xmlns="http://www.w3.org/2000/svg">
                            <circle r="25" transform="matrix(1 0 0 -1 26 26)" stroke="#5C5B5B" stroke-width="2"/>
                           <path d="M17 29L26.2124 19.7876L35.4248 29" stroke="#5C5B5B" stroke-width="2"/>
                       </svg>
                 </button>
             <?php
          }
       ?>

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question