Custom meta box in custom post type not working

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

Get posts by category name

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

Post query missing an elseif statement

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

How do I show my containing my custom field ONLY if there is a set value on that custom field? [closed]

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