• I am developing a new site using a custom theme that I built. The testing url below shows an example of the problem I am having:
    http://sptest2.unitedlightgroup.com/category/area-and-path-lighting
    That’s a category page, and it displays the two posts in the category one below the other.

    However, check out this example of a single post:
    http://sptest2.unitedlightgroup.com/solar-street-area-lighting/sunbox

    If you scroll down below the text you will notice below the main image it says “More images” and then a couple thumbnails appear followed by a small icon for a pdf file.
    My category.php template includes the same code to display the gallery of thumbs and the other file attachments that is used in single.php, and I cannot find any help in figuring out why the attachments simply are not showing up anytime the category template is used.

    My php knowledge is very limited–could it be something about my functions file? I don’t get it. If it helps, below is the snippet that is used in my single template and also my category one that calls the gallery and file attachments for each post. I would love to get to the bottom of this!

    <div class="product_foot">
          <p>More images</p>
     <?php echo do_shortcode('[gallery link="attachment" columns="5" order="DESC"]'); ?>
        <div class="clr"></div><p></p>
    <h3><dl class="attachments"><?php echo get_attachment_icons(); ?></dl></h3>

    Please help! Thank you!

Viewing 9 replies - 1 through 9 (of 9 total)
  • Hi danielklein,
    could you also post the code from your category.php? Maybe there’s something there. So far I don’t see why it shouldn’t work.
    Are you calling
    the_excerpt()
    or
    the_content()
    in your functions.php?

    Thread Starter danielkleindesign

    (@danielkleindesign)

    Hi there.
    I’m confused by your question because in my functions.php I am not actually calling either the_excerpt() or the_content() . I’m not sure why I would need to or how to do it–maybe that’s the key?

    But I appreciate your help and below is my category template in its entirety:

    [43 lines of code moderated as per the Forum Rules. The maximum number of lines of code that you can post in these forums is ten lines. Please use the pastebin]

    Thread Starter danielkleindesign

    (@danielkleindesign)

    … and if it helps, this is my functions file:

    [333 lines of code moderated as per the Forum Rules. The maximum number of lines of code that you can post in these forums is ten lines. Please use the pastebin]

    the call for excerpt or content should be either in the category.php or maybe another file entirely (loop.php ??) .
    So that’s what we need to find out. If the_excerpt is called, it may cut off content.

    Thread Starter danielkleindesign

    (@danielkleindesign)

    Sorry my code was too long, so take a look here:
    http://pastebin.com/rEnWRwKW

    for the category template. you’ll see that I am calling the_content and not the excerpt – is that what you were asking about?

    Thread Starter danielkleindesign

    (@danielkleindesign)

    You’re right. You are calling the_content so this can’t be the reason.
    Looks to me like thedo_shortcode doesn’t work in the category.php.
    I have no idea to why that is though.
    I’m sorry but I don’t see where the problem is. What about the code above the shortcode:
    <?php //echo file_gallery_shortcode( array('mimetype' => 'image/jpeg', 'order' => 'ASC', 'orderby' => 'date', 'columns' => 5, 'size' => 'thumbnail', 'link' => 'attachment', 'template' => 'default')); ?>
    Could you uncomment that and see if that works?

    Thread Starter danielkleindesign

    (@danielkleindesign)

    that’s from a plugin i tried out, but it does not work either 🙁

    Thread Starter danielkleindesign

    (@danielkleindesign)

    i guess you just cannot display attachments or galleries on archive/category pages or via a query? does anyone know of a workaround for this?

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘attachments not showing on category archive pages’ is closed to new replies.