How do I show a link or ‘Read More’ button on a custom field excerpt when it is less than the word limit

You can count the number of words in your text to check if it’s greater than 15 using the str_word_count php function, and if not return your read more link also So i would modify your custom field excerpt thus: function custom_field_excerpt() { global $post; $text = get_field(‘description’); if (” != $text) { $text = … Read more

Using Advanced Custom Fields Relationship Field to select a taxonomy term

This is based on the assumption that you have a custom field called “show_on_tax” for the custom taxonomy “Directory Entry Type”, which appears when editing a small banner (See image below). This allows you to select which custom tax terms you want the banners to appear on. This should get you sorted but drop a … Read more

Query and display only by first letter of the get_field value

Hope the below code block will help you. Please read the comments carefully. The code block- // Your previous code. // Say this is your $oder_terms variable $order_terms = array( ‘Sanchez’ => ‘Sanchez Link’, ‘Smith’ => ‘Smith Link’, ‘Dramatist’ => ‘Dramatist Link’, ‘Rashed’ => ‘Rashed Link’, ‘Munez’ => ‘Munez Link’, ‘James’ => ‘James Link’, ‘Jacky’ … Read more

Problem with adding custom CSS class to image in ACF Photo Gallery plugin [closed]

Try this code at the place where you want your gallery: <?php $images = acf_photo_gallery(‘gallery_images’, $post->ID); /// gallery_images to slug pola galeria w ACF if( count($images) ): foreach($images as $image): $full_image_url= $image[‘full_image_url’]; $class = get_field(‘gallery_images_class’, $id); echo ‘<img src=”‘.$image[‘full_image_url’].'” class=”‘.$class.'” >’; endforeach; endif; ?> Do try to check if ‘$id’ gives you the image/post id … Read more