//Get Post Data with Post or page id (WCK CTP Select field) <?php $my_meta = get_post_meta( $post->ID, 'service-stats', true ); if( !empty( $my_meta ) ){ foreach( $my_meta as $entry ){ $post_id = $entry['add-service-stats']; $my_post = get_post( $post_id ); $post_content = get_post($post_id); $content = $post_content->post_content; $post_title = $my_post->post_title; $post_img = get_the_post_thumbnail_url( $post_id, 'full'); ?> <div class="col-md-4 mb-4 mb-md-0 animateThis slideTop"> <div class="instatsBox d-flex flex-md-column flex-lg-row align-items-center g-0"> <div class="col-lg-auto col-md-12 col-auto"><img src="<?php echo $post_img; ?>" class="animateThis fadeGrow"></div> <div class="col-lg col-md-12 col ps-lg-4 ps-md-0 ps-4"> <div class="animateThis slideRight" style="transition-delay:.5s"> <div class="statsNo blueText"><?php echo $content; ?></div> <span><?php echo $post_title; ?></span> </div> </div> </div> </div> <?php }} ?>
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter