Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

In Doing an Image Gallery with Fancybox( lightbox ) using a wordpress loop, take a look at the code inside the loop:

<div class="gallery_image">
    <p style="width:201px; height:199px;">
        <a rel="gallery_fancybox" href="<?php echo $image_attributes_large[0]; ?>" title="<?php echo get_post_meta( $attachment->ID, $key, true ); ?>">
            <img style="width:187px; height:124px;" alt="" title="<?php echo get_post_meta( $attachment->ID, $key, true ); ?>" src="<?php echo $image_attributes[0]; ?>" />
            <span class="year"><?php the_time("Y"); ?></span>
            <span class="date"><?php the_time("j"); ?> de <span class="month"><?php the_time("F"); ?></span></span>
            <span class="access">Access</span>
        </a>
    </p>
</div>

There is in Another page an Image that the source is the Featured Image of this Gallery, and all of this is working without problems. However I want to do a fast change of that Featured Image, so, inside each image box loop add a button that just the admin will see ( with <?php global $user_ID; if( $user_ID ) : ?> <?php if( current_user_can('level_10') ) : ?> )that when it is clicked, the Featured Image of this Gallery change to the image that is inside that div.

Is it Possible?

Thanks a lot in Advance. Sorry for the bad English, and sorry for the weird Question.

share|improve this question

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.