WordPress Custom Fields Won’t Save

It seems you have one error in your code… if($id == $author_id){ $selected = ‘ selected=”selected”‘; } It should be $building_id instead of $author_id. I tested the rest of the code and the saving is working fine. If you had printed/echoed out the value of this line … $building_id = get_post_meta($post->ID, ‘p2p2_building’, true); like print_r($building_id);, … Read more

How to display Common posts from specific Tag & Category with Shortcode

function common_cats($att){ $args = array( ‘category__and’ => $att[‘category’], //must use category id ‘tag__in’ => $att[‘tag’], //must use tag id for this field ‘posts_per_page’ => $att[‘posts_per_page’]); //get all posts $posts = get_posts($args); $output = “<ul>”; foreach ($posts as $post) : $output .= “<li>”.get_the_title(). “</li>”; endforeach; $output .= “</ul>”; return $output; } add_shortcode(‘commoncats’, ‘common_cats’); use [commoncats] where … Read more