Articles of post meta

Track Social Link Shares & Display Them Per Post

I didn’t really want to ask here but I’m struggling to work out an issue I’m facing. I have added social links to my blog which redirect the user to the various social media sites and automatically share the post in question like so: <div class=”social-container”> <p>SHARE</p> <div class=”social-choice”> <a href=”<?php the_permalink();?>&t=<?php the_title(); ?>” target=”blank”><div […]

Dedicated post meta field vs count of meta fields

I am working a integrating a post like count to my plugin. I am having trouble understanding the logic that will impact performance. I have found this post that touches on the topic a bit. I am keeping track of the count, the IP of the user who liked the post, and the date. Scenerio […]

Saving Child Terms on front end not setting parent

I recently had a issue where I was trying to save the child terms on a front end post form. ORIGINAL POST AND CODE I thought I had it good to go but now I just realize it’s not setting the parent term as well, just the child term. $nhb_type_value = $_POST[‘nhb’]; $nhb_type = wp_get_object_terms($Property_Id, […]

How should I use posts_where to change meta_value from a string to integer?

How should I use posts_where to change meta_value from a string to integer?

Meta value does not save for scheduled posts

I created a metabox into my posts, it’s a checkbox that I checked. Here’s the code for saving the data : add_action(‘save_post’,’save_metaboxes’); function save_metaboxes($post_ID){ if (defined(‘DOING_AUTOSAVE’) && DOING_AUTOSAVE) { return $post_id; } //Don’t update on Quick Edit if (defined(‘DOING_AJAX’) ) { return $post_id; } if(isset($_POST[ ‘is_viewpay’ ])) { update_post_meta($post_ID, ‘_is_viewpay’, ‘active’); } else { update_post_meta($post_ID, […]

Updating post meta for custom post types

I’m writing a plugin for work (still) and having one more issue. I’ve added my meta boxes as needed. However, the problem I’m having occurs when saving the post. My snippets for saving pretty much come from this post. I’ve also recieved a similar answer here, but it’s just not working for some reason. :/ […]

Metabox not show in categories custom post type cmb2

it is possible to add a field in the categories (tags) in taxonomy? this is my code in functions.php function post_types(){ register_post_type(‘products’,array( ‘labels’ => array( ‘name’ => ‘Product’, ‘singular_name’ => ‘Product’, ‘all_items’ => ‘All product’, ‘add_new_item’ => ‘add new item a Products’, ‘edit_item’ => ‘Edit Product’, ‘search_items’ => ‘Search Products’, ‘not_found’ => ‘No found products.’, […]

Custom Meta Data is not being saved

I have created a custom meta box using following link in wordpress 3.0: I am using same code and custom meta data is not being saved. I get blank textbox in custom meta box each time. Please let me know what to do.

Getting metabox value?

I have a custom metabox made using the code from WordPress Reference: <?php /* Define the custom box */ // WP 3.0+ // add_action(‘add_meta_boxes’, ‘myplugin_add_custom_box’); // backwards compatible add_action(‘admin_init’, ‘myplugin_add_custom_box’, 1); /* Do something with the data entered */ add_action(‘save_post’, ‘myplugin_save_postdata’); /* Adds a box to the main column on the Post and Page […]

adding a URL to a post meta

OK, a pretty dorky question, but I am new to PHP so bear with me. How would I add an a href link to the code below so the custom meta field is linked on the front-end? <?php if(get_post_meta($post->ID, “leetpress_website”, true)) { ?> <div class=”pros”><p><strong>Movie Website: </strong> <?php echo get_post_meta($post->ID, “leetpress_website”, true); ?></p></div> <?php } […]