update custom post type meta from a shortcode
I hope you will pull the code from here. Now you have table id get_option(‘table_press’ .$table_name .”_”. $table_id); so you can chage shortcode id dynamiclly using do_shortcode().
I hope you will pull the code from here. Now you have table id get_option(‘table_press’ .$table_name .”_”. $table_id); so you can chage shortcode id dynamiclly using do_shortcode().
The code is quite tricky and difficult, cause table press math evaluation class has some protected method. By the by I solved your issue. Just the code in the functions.php in the theme.. just copy and paste it should be work. You can use multiple row sum. require_once TABLEPRESS_ABSPATH . ‘classes/class-tablepress.php’; $formula_evaluator = TablePress::load_class( ‘TablePress_Evaluate’, … Read more
Solved using this code. add_filter( ‘category_link’,’append_parameter’, 10, 2 ); function append_parameter( $link, $my_parameter ) { $my_parameter = $_GET[‘sort’]; //get sort value if ( isset($my_parameter) ) { $link = add_query_arg( ‘sort’, $my_parameter, $link ); } return $link; }
Would this post meta be better added to the post table rather than post_meta table
This is just a basic php array question – not a WP question. function unique_authors ( $authors ) { $newArray = array(); foreach( $authors as $item ) { $itemArray = explode( “, “, $item ); $newArray = array_merge($newArray, $itemArray); } $newArray = array_unique($newArray); return $newArray; } $authors = unique_authors( $authors ); foreach( $authors as $author … Read more
try the Relevanssi plugin.
get_post_meta as seen here is nothing more than a wrapper for get_metadata. Now when you say the meta you’re getting back, if its not null but rather an empty string, it means you’re hitting the end of get_metadata as seen here. With true defined as the third variable of your get_post_meta call, you should be … Read more
Couple of things: 1: When you include the script after jquery, localise it using the wp_localize_script function: $nonce = wp_create_nonce(“vote_nonce”); $yourscript_info = array( ‘ajaxurl’ => admin_url( ‘admin-ajax.php’), ‘nonce’ => $nonce ); wp_localize_script( ‘yourscript’, ‘yourscript’, $yourscript_info ); $.ajax({ type: “POST”, url: yourscript.ajaxurl, data: { id: id, vote: vote, nonce: yourscript.nonce, action: “stn_voting” }, 2: Add some … Read more
Your meta value is a serialized array. What you’re asking it to get for you is all posts with a meta with the key ‘Notes’ and the value ‘price’. Your meta value is not ‘price’, though, it’s a:6:{s:5:”width”;s:3:”580″;s:6:”price”;s:3:”99″ The first thing you need to do to order by price is to start using a helpful … Read more
Thanks to @Howdy_McGee. He gave me the hint to look after serialized meta queries. With this code I get the desired result. $args = array( ‘posts_per_page’ => -1, ‘orderby’ => ‘post_date’, ‘order’ => ‘DESC’, ‘post_status’ => ‘publish’, ‘meta_query’ => array( array( ‘key’ => ‘enterprise_on_page’, ‘value’ => serialize(strval(‘trainees’)), ‘compare’ => ‘LIKE’, ), ), ); $enterprise_posts = … Read more