How do I modify the with wp_nav_menu()

Welcome to WPSO. You need to modify the Walker_Nav_Menu Class. That class is responsible for rendering the HTML menu output in first place. The theme you are using is calling the WordPress menu class, which will then output your menu. As alexwc_ mentioned the alt attribute is for images, not for anchor tags. So in … Read more

Cannot get custom javascript to execute on page

Try this. add_action ( ‘wp_head’, ‘custom_script_hook’); function custom_script_hook() { ?> <script type=”text/javascript” src=”https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js”></script> <?php $output=”<script> jQuery(document).ready(() => { $(“div#tm-extra-product-options”).click(() => { console.log(“it working!”) }); }); </script>”; echo $output; }

Global variables and re-use

In general programming, globals are bad practice: You can’t easily look at the use of a global in one place and see all the other uses, e.g. where it was set or will be read later. You have many places to change the use of that variable if e.g. the use or format of it … Read more

Custom Shortcode with Dynamic Button

This may not be a direct answer to your shortcode issue. But try doing it as a post template, from there its easier to handle post data. You have a working button below the description. Copy it and place it on the bottom. And use Class to trigger your JS this time.

How to set if meta_value is lower < than other meta_value in a get_posts array?

Use this type of code : $args = array( ‘author’ => $publisher_info->ID, ‘post_type’ => ‘post’, ‘tax_query’ => array( array( ‘taxonomy’ => ‘type’, ‘field’ => ‘slug’, ‘terms’ => array( ‘campaign’ ), ) ), ‘meta_query’ => array( ‘relation’ => ‘AND’, array( ‘key’ => ‘status’, ‘value’ => ‘active’, ‘compare’ => ‘=’), array( ‘key’ => ‘B’, ‘value’ => ‘1’, … Read more