Search code examples
wordpressthumbnailsbuddypress

How to resize Buddypress BP Album thumbnail image sizes on homepage only?


I am using the BP Album plugin on a Buddypress installation.

Using the following code, I am able to display the most recent image uploads (Latest Photos) in a block on the homepage:

<?php $args = array(
    'action' => bp_album_picture,
    'max' => 5
); 
?>

    <?php if ( bp_has_activities( $args) ) : ?>

        <ul id="image-strip">

        <?php while (bp_activities()) : bp_the_activity(); ?>

            <li><?php echo implode(explode("</a>", bp_get_activity_content_body(), -1)); ?></li>

        <?php endwhile; ?>

        </ul>

    <?php endif; ?> 

My problem is that the thumbnails are the size specified in the BP Album settings (100 x 100 pixels).

How can I have ONLY the Latest Photos thumbnails be a different size (e.g. 50 x 50)?


Solution

  • So you don't want the image link... ?

    Then maybe...

    You could do your implode/explode, to remove the < a > tag, before the < li >.

    Then implode/explode again between < img and src and insert class="yourthumbnail"

    Then echo the result in the < li >

    And add to your css:

    img.yourthumbnail { width: 50px; height: 50px; }