Exclude in get_pages() based on meta field

You can using get_posts(). $pages_args = array( ‘orderby’ => ‘menu_order’, ‘parent’ => 0, ‘post_type’ => ‘guideline’, ‘post_status’ => ‘publish’, ‘meta_key’ => ‘no-visit’, ‘meta_value’ => ‘true’ ); $pages = get_posts($pages_args); $pages_args = array( ‘orderby’ => ‘menu_order’, ‘parent’ => 0, ‘post_type’ => ‘guideline’, ‘post_status’ => ‘publish’, ‘meta_query’ => array( array( ‘key’ => ‘no-visit’, ‘value’ => ‘true’, ‘compare’ … Read more

TinyMCE’s “Clear Formatting” button doesn’t remove lists and headings

I need to answer my own question here. I was using the attributes from TinyMCE v3, but it needed to use the v4 format. Here’s what works: add_action( ‘acf/input/admin_footer’, function() { ?> <script type=”text/javascript”> ( function( $ ) { acf.add_filter( ‘wysiwyg_tinymce_settings’, function( mceInit, id, field ) { mceInit[‘formats’][‘removeformat’] = [{ selector: ‘h1,h2,h3,h4,h5,h6,ul,li,b,strong,em,i,span,blockquote,pre,code’, remove: ‘all’, split … Read more

Need to search a custom field (ingredients, one long string per post), but want it to allow phrases/non-exact matches

You could break apart the search-string into an array and add each word to it’s own meta-query $search_query = ‘strawberries and cream’; $search_query_array = explode(‘ ‘, $search_query); // turn search query string into array of words $stop_words = [‘and’,’or’,’that’,’have’,’with’,’this’]; if ( ! empty( $search_query_array ) ) { foreach( $search_query_array as $index ) { // remove … Read more

getting image from ACF

Thank you for your question. As other said, you can’t mix shortcode in the HTML attributes. You’ll need to edit the Ultimate Members PHP template. Check in their doc how to edit them in a child theme to not lose them on Ultimate Member update. You will need to make something like: <?php if ( … Read more

ACF get_sub_field ALT TAG in the repeater doesn’t show

See here for ACF image docs. https://www.advancedcustomfields.com/resources/image/ If image field is set to return as an array then you need store the image subfield into a variable and use the variable to output the array keys. So in your case, it would be like this… <?php while( have_rows(‘logo_list’) ) : the_row();?> <?php $image = get_sub_field(‘image’); … Read more