Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Forum: Fixing WordPress
    In reply to: Gallery Navigation

    For those of you using K2… The issue is in the theme itself. Both the single.php and index.php (main site and single post) utilize the same loop in “theloop.php.” Due to this, just simply adding the previously mentioned code did not properly allow for the viewing of the actual gallery page within the “single” area.

    Thus, changing :

    if(in_category(3)) {

    to:

    if(!is_single() && in_category(3)) {

    This alters the rendering of a single page in order to produce the ‘normal’ look as opposed to the altered look for something similar to ma.tt.

    Forum: Fixing WordPress
    In reply to: Gallery Navigation

    I altered your code ever so slightly…

    <?php
    if(in_category(14)) {
    $args = array(
    	'post_type' => 'attachment',
    	'numberposts' => 1,
    	'order' => 'ASC',
    	'post_status' => null,
    	'post_parent' => $post->ID
    	);
    $attachments = get_posts($args);
    if ($attachments) {
    	foreach ($attachments as $attachment) {
    		$thePic = wp_get_attachment_image($attachment->ID);
    	}
    }
    ?>
    <p><a href="<?php the_permalink(); ?>"><?php echo $thePic; ?></a></p>
    <?php continue; } else {
    the_content('Read the rest of this entry &raquo;');
    } ?>

    If you notice, at the end of thePic, I added a continue;

    This accomplishes one thing on my blog… the post was showing up twice. Now I can go in and format this directly, and it doesn’t require any truly extra work within the code other than leaving this in there.

    Interestingly enough, and I can’t figure out why for sure, but when using this in theloop.php when k2 is enabled, the gallery doesn’t function properly – instead it just constantly shows the single picture.

    Nevertheless…

    You have brought me a million steps closer to what I was hoping the true functionality would be with the gallery.

    Applaud and gratitude all around 🙂

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