WordPress.org

Ready to get started?Download WordPress

Forums

Last attachment post duplicating (1 post)

  1. ddeuster
    Member
    Posted 1 year ago #

    Trying to trouble shoot why the last attachment in our post is duplicating. Example post:
    http://www.ourgoodfight.com/?p=6165

    Here is the code that is generating the attachments

    <?php
    $args = array(
    	'post_type' => 'attachment',
    	'post_mime_type' => 'audio/mpeg',
    	'numberposts' => -1,
    	'orderby' => 'menu_order',
    	'order'  => 'ASC',
    	'post_status' => null,
    	'post_parent' => $post->ID, // this post
    	);
    ?>
    
    <!--This is where the audio attachments will go -->
    
    <?php $posts = get_posts($args);
    foreach ($posts as $post) : start_wp(); ?>
    <p>
    <a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a>
    </p>
    <?php endforeach; ?>
                                <!--This is the end of the audio attachments -->

    Thanks.

Topic Closed

This topic has been closed to new replies.

About this Topic