ART 0 ارسال شده در تیر 92 گزارش بازنشر ارسال شده در تیر 92 سلاممن یه اسلایدر درست کردم و می خوام عکس هایی که در گالری وردپرس ساخته میشه در این اسلایدر بیادچطوری می تونم ؟ممنون نقل قول لینک به ارسال
isk 4447 ارسال شده در تیر 92 گزارش بازنشر ارسال شده در تیر 92 چطوریشو شما باید بفرمایید - شما اسلایدر ساختید و می دونید چی ساختیدگالری در یک پست تولید میشه و در هر پست ممکنه یک یا چند گالری وجود داشته باشهحالا اسلایدر شما در کجا قراره نمایش داده بشه و قراره کدوم یکی از گالری ها رو اسلاید کنه؟ 1 نقل قول لینک به ارسال
ART 0 ارسال شده در تیر 92 مالک گزارش بازنشر ارسال شده در تیر 92 گالری خارج از پست میاد و مجزاستمن فقط بدونم کد manaul چی هست دیگه خودم جاسازی می کنم نقل قول لینک به ارسال
Morteza 34190 ارسال شده در تیر 92 گزارش بازنشر ارسال شده در تیر 92 این دو کد رو بررسی کنید: <?php$attachments = get_children(array('post_parent' => $post->ID, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => 'ASC', 'orderby' => 'menu_order ID'));foreach($attachments as $att_id => $attachment) {$full_img_url = wp_get_attachment_url($attachment->ID); $split_pos = strpos($full_img_url, 'wp-content'); $split_len = (strlen($full_img_url) - $split_pos); $abs_img_url = substr($full_img_url, $split_pos, $split_len); $full_info = @getimagesize(ABSPATH.$abs_img_url); ?> <div class="WallSizesHolder"> <div class="WallSizesThumbHolder"> <a href="<?php echo $full_img_url; ?>" title="<?php echo $attachment->post_title; ?>" target="_blank"><img src="<?php bloginfo('stylesheet_directory'); ?>/thumb.php?src=<?php echo $full_img_url; ?>&w=92&h=69&zc=1" /></a> </div> <p><?php echo $full_info[0].'x'.$full_info[1]; ?></p></div><?php}?> و WPBeginner» Blog» Themes» How to Get All Post Attachmen…How to Get All Post Attachments in WordPress Except for Featured ImageLast updated on February 6th, 2012 by Editorial StaffShare & Comment7010813BlueHost - Recommended WordPress HostingHow to Get All Post Attachments in WordPress Except for Featured ImageRecently while working on a custom project for a client, we had to get all post attachments from a custom post type and display them at one place. Because we were creating a grid display, we had each post’s featured image serving the purpose of a separator. This is why when getting all post attachments, we needed to exclude the featured image, so it doesn’t show up twice. In this article, we will show you how to get all post attachments in WordPress except for the featured image.All you have to do is paste the following code inside a loop.<?php if ( $post->post_type == 'data-design' && $post->post_status == 'publish' ) { $attachments = get_posts( array( 'post_type' => 'attachment', 'posts_per_page' => -1, 'post_parent' => $post->ID, 'exclude' => get_post_thumbnail_id() ) ); if ( $attachments ) { foreach ( $attachments as $attachment ) { $class = "post-attachment mime-" . sanitize_title( $attachment->post_mime_type ); $thumbimg = wp_get_attachment_link( $attachment->ID, 'thumbnail-size', true ); echo '<li class="' . $class . ' data-design-thumbnail">' . $thumbimg . '</li>'; } }}?> نقل قول لینک به ارسال
پست های پیشنهاد شده
به گفتگو بپیوندید
هم اکنون می توانید مطلب خود را ارسال نمایید و بعداً ثبت نام کنید. اگر حساب کاربری دارید، برای ارسال با حساب کاربری خود اکنون وارد شوید .