Forum Replies Created

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter bigskydj09

    (@bigskydj09)

    Resolved: The answer was to assign a count to each attachment:

    $args = array(
    		'post_type' => 'attachment',
    		'numberposts' => -1,
    		'post_status' => null,
    		'post_parent' => $post->ID,
    		'order_by' => 'menu_order',
    		'order' => 'DESC'
    	);
    
    	$attachments = get_posts( $args );
    		if ( $attachments ) {
    		$count = 0;
    			foreach ($attachments as $attachment) {
    				$link = get_permalink($attachment->ID);
    				$link = add_query_arg('img',$count,$link);
    					echo '<div class="thumbnail">';
    					echo '<a href="'.$link.'" >';
    					echo wp_get_attachment_image( $attachment->ID, 'small' );
    					echo '</a>';
    					echo '</div>';
    					$count++;
    			}
    		}

    And then link up with that on attachment page.

    Thread Starter bigskydj09

    (@bigskydj09)

    It turns out the images HAVE TO BE ATTACHED…which is to say, they cannot be hyperlinked. Other than that, the code is sound.

    Thread Starter bigskydj09

    (@bigskydj09)

    Ok, so I got the whole deal working! However, the drop-down menu stays, well, dropped-down while navigating my blog as well. Here is the kicker though: it only stays dropped for the first page of the blog. When I navigate to page 2, page 3, and so on, it disappears (as it should). Any ideas?!

    <?php wp_list_categories('include=11&title_li='); ?>
    	<?php
    	if ( in_category( 'collaborations' ) || is_single('collaborations')) { ?>
    	<ul class="child">
    	<?php previous_post_link_plus( array('link' => 'Previous', 'format' => '%link', 'loop' => true, 'in_same_cat' => true) ); ?> ||
    	<?php next_post_link_plus( array('link' => 'Next', 'format' => '%link', 'loop' => true, 'in_same_cat' => true) ); ?>
    	</ul>
    	<?php } ?>

    PS…I am using the link plus plugin, thus the code “post_link_plus”

    Thanks in advance!

    Thread Starter bigskydj09

    (@bigskydj09)

    Sorry, code link below:

    https://pastebin.com/sCCi9tsz

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