• Resolved eazy24

    (@eazy24)


    Hi,
    i have on my template page this code above,when image clicked, then it goes single portfolio item page,but i want to use the_post_thumbnail( ‘full’ ); to open that image in full.
    i am trying to do that with featherlight

    <a class="thumbnail" href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>">
    						<?php the_post_thumbnail('featuredImageCropped'); ?>
    					</a>

    on single portfolio page i use

    <div id="mylightbox">
    						<a href="#" data-featherlight="#mylightbox"><?php
    						if ( has_post_thumbnail() ) {
    							the_post_thumbnail();
    						}
    						the_content();?></a>
    					</div>

    and it works,but not on that page where i want it, also when i use this code on that page then it works,but it opens always only the same as first image for every image i click.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter eazy24

    (@eazy24)

    found a solution,only one problem,need change the_title_attribute to?

    <div id="mylightbox">
    
    						<?php
    						if ( has_post_thumbnail()) {
    							$full_image_url = wp_get_attachment_image_src( get_post_thumbnail_id(), 'full');
    							echo '<a class="thumbnail" href="' . $full_image_url[0] . '" title="' . the_title_attribute('echo=0') . '" data-featherlight="' . the_title_attribute('#mylightbox') . '" >';
    							the_post_thumbnail('thumbnail');
    							echo '</a>';
    						}
    						?>
    					</div>
    Thread Starter eazy24

    (@eazy24)

    solved,fixed

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘open featuredImageCropped thumbnail in the_post_thumbnail( 'full' );’ is closed to new replies.