Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Forum: Hacks
    In reply to: Multiple Attachment List
    Thread Starter bulerobul

    (@bulerobul)

    ok, bcworkz

    $html_tab_images_3 = '';
    			$args = array(
    				'post_type' => 'attachment',
    				'meta_key' => 'gosterilecek_tab',
    				'meta_value' => 'tab-2',
    				'numberposts' => -1,
    				'post_status' => 'inherit',
    
    				//'post_parent' => get_field('tab-2-icerik-id'),
                                    //'post__in' => array(2744,2748),
    				'exclude' => get_post_thumbnail_id()
    				);
    			$attachments_3 = get_posts( $args );
    
    			if( $attachments_3 ) {
    				$i = 1;
    				$html_tab_images_3 .= '<div id="pimages-2" class="tab-content" style="margin-left:15px;">';
    				foreach( $attachments_3 as $attachment ) {
    					if( $i % 4 == 0 ) $switch_class = ' alpha omega';
    					elseif( ( $i - 4 ) % 2 == 0 ) $switch_class = '';
    					else $switch_class = '';
    					$large_image_url = wp_get_attachment_image_src( $attachment->ID, 'large' );
    					$html_tab_images_3 .= '<span style="width: 130px;" class="prodimgwrap alignleft' . $switch_class . '"><a href="' . $large_image_url[ 0 ] . '" title="' . the_title_attribute( 'echo=0' ) . '">';
    					$html_tab_images_3 .= wp_get_attachment_image( $attachment->ID, 'thumbnail' );
    					$html_tab_images_3 .= '</a><span class="imgshadow"><span class="shadowleft">&nbsp;</span><span class="shadowright">&nbsp;</span></span></span>';
    					$i ++;
    				}
    				echo '</div>';
    			}
    Forum: Hacks
    In reply to: Multiple Attachment List
    Thread Starter bulerobul

    (@bulerobul)

    🙁 not working.

    example:
    Post A – 2 attachments
    Post B – 1 attachments
    Post C – 3 attachments

    $args = array(
    				'post_type' => 'attachment',
    				'meta_key' => 'gosterilecek_tab',
    				'meta_value' => 'tab-2',
    				'numberposts' => -1,
    				'post_status' => 'inherit',
                                    ??'post_parent' => A,B,C,
    				'exclude' => get_post_thumbnail_id()
    				);

    result of listing :
    total listing item: 6

    I do not know english. I’m sorry

Viewing 2 replies - 1 through 2 (of 2 total)