Function returning queried meta value based on current post ID

You can still do the AS with $wpdb, I find it still makes stuff look cleaner. You can use the $wpdb->prepare() method for sanitation. Are you looking for something like this? function combined_downloads($post_id) { global $wpdb; return $wpdb->get_var($wpdb->prepare( “SELECT SUM( meta_value ) FROM $wpdb->postmeta AS m LEFT JOIN $wpdb->posts AS p ON m.post_id = p.ID … Read more

Issues with add_query_arg() not passing a variable

I ended up using a GET method and got rid of add_query_arg() function $homezip = $_GET[“search”]; <form action=”local-concert-listings/” method=”get”> <input id=”address” size=”6″ type=”text” placeholder=”Zipcode” name=”zipcode”/> <div style=”display:none;”> <input id=”volume” size=”1″ name=”miles” value=”70″ placeholder=”70″></input> </div> <input type=”submit” value=”go” name=”SubmitButton” onclick=”codeAddress()” /> </form>

custom post with loading script per single post

What if you completely remove the loadDonateScripts function and just add the conditional before enqueuing the scripts like in the the following: function donate_adding_scripts() { if (is_single()) { global $post; if($post->ID==”8436″){ // only for post Id = 8436 wp_register_script(‘donateParsleyJs’, get_template_directory_uri() . ‘/js/parsley.min.js’, array(‘jquery’),’1.11.1′); wp_enqueue_script(‘donateParsleyJs’); wp_register_script(‘donateParsleyHeJs’, get_template_directory_uri() . ‘/js/he.js’); wp_enqueue_script(‘donateParsleyHeJs’); wp_register_script(‘donateJs’, get_template_directory_uri() . ‘/js/donateJs.js’, array(‘jquery’),’1.11.1′, true); … Read more