Why are my custom metaboxes not updating the post meta?
Why are my custom metaboxes not updating the post meta?
Why are my custom metaboxes not updating the post meta?
I think this is what you are looking for You need to get the custom post meta and add it to the wp_add_inline_style( $handle, $data );, I advise using the “style” default handle. The position of your custom css will depend on the hook of your stylesheet.
Use $wpdb->get_results with filter based on array
I’m sure there’s a better approach, but this query should do what you want: SELECT DISTINCT meta_value FROM wp_postmeta pm WHERE meta_key = ‘Driver’ AND NOT EXISTS (SELECT * FROM wp_term_relationships tr JOIN wp_term_taxonomy tt ON tt.term_taxonomy_id = tr.term_taxonomy_id JOIN wp_terms t ON t.term_id = tt.term_id WHERE pm.post_id = tr.object_id AND tt.taxonomy = ‘category’ AND … Read more
I have managed to remove this. If anyone else is wondering how simply go to. /themes/theme-name/includes/helpers open up SEO.php. And do Ctrl+F for generator or Wow-Themes.
In the end it was a plugin and my code conflicting with each other. Both were saving my post_meta. Resulting in odd behavior of my code and functionality of retrieving the data.
ok, I was close and I have solution: SELECT wp_posts.ID, wp_postmeta.meta_value FROM wp_postmeta INNER JOIN wp_posts ON wp_posts.ID = wp_postmeta.post_id INNER JOIN wp_term_relationships ON (wp_posts.ID = wp_term_relationships.object_id) INNER JOIN wp_term_relationships AS tt1 ON (wp_posts.ID = tt1.object_id) WHERE 1=1 AND wp_postmeta.meta_key = ‘_application’ AND ( wp_term_relationships.term_taxonomy_id IN (31) AND tt1.term_taxonomy_id IN (14) )
I think the sort is either alphabetical or numerical. There is no API way to provide more elaborate sorting rules to the query and messing with SQL for it would be likely impractical. Since you are retrieving complete set of posts (don’t have to worry about pagination) the easiest way would be: Request no sort … Read more
Ultimately the solution that I found was to use global $post; to retrieve the current post’s ID. Immediately after wp_insert_post( $new_cpta ); above, I added global $post; $currentid = $post->ID; Then I was able to update the post meta for the correct post with $currentid in place of $post_id.
I got it solved…. function filter_image_send_to_editor($html, $id, $caption, $title, $align, $url, $size, $alt) { $animatedGif = (bool) get_post_meta($id, ‘animated_gif’, true); if($animatedGif){ $gifCoverImgUrl = get_post_meta( $id, ‘animated_gif_cover_url’, true ); // build my GIF player if(isset($gifCoverImgUrl) && $gifCoverImgUrl != ”){ $doc = new DOMDocument(); $doc->loadHTML($html); $xpath = new DOMXPath($doc); $src = $xpath->evaluate(“string(//img/@src)”); $html=”<img class=”gifplayer” src=””.$gifCoverImgUrl.'” data-gif=”‘.$src.'” />’; … Read more