Hide A Class and Add Custom HTML Code Using WordPress

You mixed JavaScript code with css. Going by the code you provided you would need to do this. <?php if (!is_user_logged_in()) : ?> <style> .product-purchase-box{ display: none; } </style> <script> ($ => { $(“.single-product-widget”).text(“Please Login/Register To Download”); })(jQuery); </script> <?php endif; ?>

Adding HTML Code to Replace Text in PHP

One way to handle this with the approach you’ve taken is to expand on the PHP code for the check to see if the user is logged in like so: <?php if (!is_user_logged_in()) : ?> <style> .product-purchase-box{display: none;} .linktologin{display: inline;} </style> <?php else : ?> <style> .product-purchase-box{display: inline;} .linktologin{display: none;} </style> <?php endif; ?> Then, … Read more

Using a new WP_Query inside the loop

It seems that the following code is at fault: $query_args[‘tax_query’] = array( array( ‘taxonomy’ => ‘edd_log_type’, ‘field’ => ‘slug’, ‘terms’ => ‘file_download’, ) ); It seems to be combining the tax_query args with those from the search query itself, by removing this I am getting a better result, although it is counting ALL logs, not … Read more