Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Cuctom Meta Box (CMB) ব্যবহার করে images upload করার নিয়ম |
- /*****************************************************************************************/
- <!---------------------------------------------------------------------------------------->
- <?php
- global $post;
- $args = array( 'posts_per_page' =>-1, 'post_type'=> 'twenty_slider'); // thiscome from custom-posts.php
- $myposts = get_posts( $args );
- foreach( $myposts as $post ) : setup_postdata($post); ?> <!----- endforeach start here & see below------>
- <!------------------------------------------------------------------------------------------->
- <?php
- $image = get_post_meta($post->ID, 'twenty_meta_img1', true); // This is for custom meta box (CMB)
- ?>
- <!------------------------------------------------------------------------------------------------->
- <?php if($image):?>
- <img src="<?php echo $image;?>" alt="" style="height:297px;width:593px;"/> <!--this has beeen called from CMB data input--->
- <?php else:?> <!---if the above image did not found then the below image will get from our theme directory this is default-->
- <img src="<?php echo get_template_directory_uri();?>/img/1_1.jpg" alt="" />
- <?php endif;?>
- <!----------------------------------------------------------------------------------------------------------->
- <?php endforeach;?> <!----- endforeach end here & see above------>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement