Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #20815
    lester000000
    Participant

    Hello,

    I have written a WP query and I have a problem for display ordering images in attachment to the article. If I change the order of the images in the backoffice with the Download Attachments plugin, this sort is not displayed on the frontoffice page.

    I must be mistaken in the call of the parameter “menu_order”, we must probably put something else.

    Could anyone help me to modify this code below and allow me to see frontoffice my ranking done in backoffice?

    Thank you very much for your help.

    t.

    $thumb_ID = get_post_thumbnail_id( $post->ID );
        $args = array( 'post_type' => 'attachment', 'numberposts' => -1, 'post_parent' => $post->ID, 'post__not_in' => array( $thumb_ID ), 'orderby' => 'menu_order', 'order' => 'ASC', );
        $attachments = get_posts( $args );
        if ( $attachments ) {
           
     foreach ( $attachments as $attachment ) {
                $image_attributes = wp_get_attachment_image_src( $attachment->ID, '' );
                $image_vignettes = wp_get_attachment_image_src( $attachment->ID, 'vignette' );
                echo '<div class="grid-item"><a href="';
                echo $image_attributes[0];
                echo '">';
                echo '<img src="ui/i/blank.gif" alt="" data-echo="'.$image_vignettes[0].'" width="'.$image_vignettes[1].'" height="'.$image_vignettes[2].'" >';
                echo '</a></div>';  
    	}
    #21814
    Anonymous
    Inactive

    Hey guys if you are really the online game player then here on our homepage you will play free happy wheels online video game you can play happy wheel game online on your pc tablet and on your smartphone without any download and registration the happy wheel game is based on the rag-doll theory of physics you loves to play it for free.

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.