Display custom image field in user profile

Check out the documentation for ACF image fields: https://www.advancedcustomfields.com/resources/image/ When you use get_field on an image field, it looks like it returns the ID for the image, not a URL. This might have been different in a previous version of ACF. I think something like this might work: $image = get_field(‘user_avatar’, $user->ID’); $size=”full”; // (thumbnail, … Read more

advanced custom fields if field has value show main div [closed]

Please try below and let me know if any query. <?php if( get_field(‘packaging_details’) || get_field(‘port’) || get_field(‘lead_time’)): ?> <div class=”prd-overview-list”> <h3>Packaging & Delivery</h3> <ul> <?php if( get_field(‘packaging_details’) ): ?><li><p>Packaging Details</p> <p><span><?php the_field( ‘packaging_details’ ); ?></span></p></li><?php endif; ?> <?php if( get_field(‘port’) ): ?><li><p>Port</p> <p><span><?php the_field( ‘port’ ); ?></span></p></li><?php endif; ?> <?php if( get_field(‘lead_time’) ): ?><li><p>Lead Time</p> … Read more

Create Shortcode for php code in functions.php

If your code works fine then do this in function.php <?php add_shortcode( ‘custom_name’, ‘footag_func’ ); function footag_func( $atts ) { $html=””; $posts = get_field(‘related_posts’, false, false); $loop = new WP_Query(array(‘post_type’ => ‘post’, ‘posts_per_page’ => 3, ‘post__in’ => $posts, ‘post_status’ => ‘publish’, ‘orderby’ => ‘post__in’, ‘order’ => ‘ASC’ )); if($loop->have_posts()) { $html .= ‘<div class=”rel-posts”>’; while … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)