Output richtext metabox value
Try echo html_entity_decode($ccontent) .
Try echo html_entity_decode($ccontent) .
I’m not sure if this is the whole problem but it seems you ‘posts_per_page’ is sitting inside your ‘meta_query’ while it should sit in the same level as ‘post_type’ and ‘category_name’…
forget about using wp_editor on such scenario.. instead use the core tinymce, something like; tinymce.init({ //selector: ‘customEditor-‘ + nextPlusSignId, editor_selector: ‘nwac_editor_’ + nextPlusSignId, mode: “specific_textareas”, media_buttons: false, menubar: false, content_css: nw.baseurl + ‘/skins/wordpress/wp-content.css’, body_class: ‘mce-content-body nwac_plus_signs_’ + nextPlusSignId + ‘_template post-type-products post-status-publish mceContentBody webkit wp-editor wp-autoresize html4-captions has-focus’, });
Check to see if it’s empty before you show the div. <?php $true_title = get_post_meta( $post->ID, ‘true_title’, true ); ?> <?php if( ! empty( $true_title ) ) : ?> <div class=”discuss”><a href=”https://wordpress.stackexchange.com/questions/166858/<?php echo $true_title; ?>”>Discuss…</a></div> <?php endif; ?>
Before the foreach loop: foreach($authors as $author) { Add this empty option element: echo ‘<option value=”0″></option>’; Hope it works! 🙂
Hey Change Callback function to like this and add_meta_box to add_meta_boxes hook function create_meta_box_slider() { add_meta_box( ‘new-meta-boxes-slider’, __(‘slider Settings’), ‘new_meta_box’, ‘slider’, ‘normal’, ‘high’ ); } add_action(‘add_meta_boxes’, ‘create_meta_box_slider’); function new_meta_box() { global $meta_box_groups; $meta_box_groups[] = $slide_info; } I think it work fine
You could do it with something like this in theme functions.php (at end) add_action(‘admin_menu’, ‘news_admin_test’); function news_admin_test() { add_menu_page( ‘News Page Title’, ‘News Option’, ‘manage_options’, ‘newspage’, ‘show_menu_news’, get_home_url() .’/wp-content/themes/my_theme/assets/img/logo.png’ ); } function show_menu_news () { echo ‘News content’; }
You can print the values of the array like this: $colors = get_post_meta($post->ID, $prefix . ‘colors’, true); foreach($colors as $color){ echo $color; }
I’ve found my problem. The choice was indeed being saved, just wasn’t showing to me at the editor (it was always showing me the first choice). The thing is, the $selected function compares the selected input with the string provided which, in my case, was incorrectly filled. so the following code: <select name=”estadoDaObra” id=”estadoDaObra”> <option … Read more
The problem was with this line: if(!$related_resources OR $related_resources == ”) return; I changed it to: if($related_resources == ”) return; And it started working properly. I hope others can make use of the code too. Thanks!