Display metabox title for custom fields with values

You can add another simple foreach loop to check if you have any values first: foreach ( $meta_boxes as $metabox ) { $has_value = false foreach ( $metabox[‘fields’] as $field ) { $meta = get_post_meta($post->ID, $field[‘id’], true); if(!isset($meta[0])){ $need_title = true; break; } } if ($has_value){ echo $metabox[‘title’]; foreach ( $metabox[‘fields’] as $field ) { … Read more

Page not found yet the posts are listed?

It’s not correct solving of issue and it’s not a bug. Here is explanation why it happens: “Pagination is calculated before you get to the template file that runs query_posts. The proper way to alter posts_per_page conditionally is to use the pre_get_posts hook to modify the main query.” https://wordpress.stackexchange.com/a/42063/17177 I found one implementation “pre_get_posts” that … Read more

Loop info in jquery Tabs – loop into a variable?

You would have to perform the query for each respective tab. If you are using WP_Query then you can perform the query and then use $found_posts to return the total number of posts matching that query. For instance, $query_tab_1 = new WP_Query($args); //Where $args is some arguments for your query $tab_1_count = $query_tab_1->found_posts; The $query_tab_1 … Read more