Shortcode not work in picture source srcset tag

i fix this with a new shortcode that generates the entire tag. Like this: function generate_image_tag($atts) { $atts = shortcode_atts( array( ‘img’ => ”, ‘title’ => ”, ‘theme_url’ => get_bloginfo(‘template_url’), ), $atts ); //File path details $file_info = pathinfo($atts[‘img’]); $file_dir = $file_info[‘dirname’] != ‘.’ ? $file_info[‘dirname’].”https://wordpress.stackexchange.com/” : ”; $file_url = $file_dir . $file_info[‘filename’]; $output=”<picture> <source … Read more

Create a CPT to edit Shortcodes Atts

Add below code on functions.php file and that’s it…………… Here, I use slick slider for the carousel view you can change as per your choice. replace word post with respected post slug in below lines add_meta_box ( ‘customdiv’, ‘Image Gallery’, ‘custom_print_box’, ‘post’, ‘normal’, ‘high’ ); && manage_post_posts_columns && manage_post_posts_custom_column simply add shortcode in any of … Read more

Block error message in foreach loop when looping through ACF field

For those who are looking for an answer – after trial and error i found the “if” statement i was looking for. Full code as follows: $variablename = get_field(‘dcfg_global_item_select’); if ( !empty( $variablename ) ) {?> <div class=”container”> <?php foreach($variablename as $variablename2):?> <a href=”<?php echo get_page_link($variablename2 ->ID);?>”> <center> <img src=”<?php echo get_the_post_thumbnail_url($variablename2->ID, ‘medium’);?>”> </center> </a> … Read more