admin_notices show after load completed

Those are not admin notices. It’s not enough to echo text on the admin_notices hook, it needs to be wrapped in specific HTML. Here is an example taken from the official WP doc for admin_notices: function sample_admin_notice__success() { ?> <div class=”notice notice-success is-dismissible”> <p><?php _e( ‘Done!’, ‘sample-text-domain’ ); ?></p> </div> <?php } add_action( ‘admin_notices’, ‘sample_admin_notice__success’ … Read more

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