Set Default Option Value as Blank for Meta Box
Before the foreach loop: foreach($authors as $author) { Add this empty option element: echo ‘<option value=”0″></option>’; Hope it works! 🙂
Before the foreach loop: foreach($authors as $author) { Add this empty option element: echo ‘<option value=”0″></option>’; Hope it works! 🙂
If u do not want to hack a lot into function.php of your wordpress, I would like to suggest you use: Admin Menu Editor PLUGIN, Lets you directly edit the WordPress admin menu. You can re-order, hide or rename existing menus, add custom menus and more. which works great for me. But anyway if u … Read more
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
Probably you can achieve this easily with the plugin you mentioned, Advanced Custom Fields. But if you can code a bit, there is a way to easily implement this with no plugin. You can create a metabox with custom fields and attach it to the homepage custom post type, if that’s how you have it … Read more
list all the PAGES that are assigned to particular page(s). I’m assuming you mean “particular term(s).” which would be in your clinical-programs taxonomy. You’ll have to do a bit of coding – you need to start a new WP_Query and structure your query as such: $taxPages = new WP_Query( array( ‘post_type’ => ‘YOUR_POSTTYPE_HERE’, ‘clinical-programs’ => … Read more
The else in PHP goes at the end of the if statements closing bracket, look at the following: if( 1 == 1 ) { echo ‘true!’; } else { echo ‘false.’; } So you code would look something like this: <?php $posts = get_posts(array( ‘post_type’ => ‘retail_units’, ‘orderby’ => ‘date’, ‘order’ => ‘ASC’ )); if( … Read more
When you register your taxonomy, set the slug parameter of rewrite to your desired structure: register_taxonomy( ‘custom_tax’, ‘custom_post_type’, array( ‘rewrite’ => array( ‘slug’ => ‘your-cpt-slug/category’ ), // your other args… ) );
You can pass boolean false to supports to have post type support nothing at all. However note that: you might run into issues with saving “empty” posts (not having one of title/editor/excerpt) likely you still want it to support custom-fields at least, rather than nothing at all
There isn’t a single hook for both, the new post page is admin_head-post-new.php.
You can use get_field from ACF to check if the field is available and according to the documentation how you conditionally check if a field has contents. <div class=”wrapper”> <?php if (get_field(‘discount’)) { ?> <p>Discount: <?php the_field(‘discount’); ?></p> <?php } else { ?> <p>Price: <?php the_field(‘price’); ?></p> <?php } ?> </div><!–wrapper-end–> This should give you … Read more