Reply To: Thumbnail gallery for image posts

Your Account / Forums / Easy FancyBox Pro / Thumbnail gallery for image posts / Reply To: Thumbnail gallery for image posts

July 11, 2016 at 8:21 pm #6755

Is that the theme called “Uploader – Advanced Media Sharing Theme” available on ThemeForest?

If so, please be aware that if you modify any theme files, these modifications will be overwritten on the next update. To prevent this, you could consider creating a Child Theme but I could not tell you if the Uploader theme can serve as a Parent Theme at all. Some themes are just not suitable for that… You might consider asking the theme developer if the theme can serve as a Parent Theme and if they can give you a basic tutorial which you can follow.

Next step will indeed be to modify that snippet that you gave above.

Let’s concentrate on these lines:


$attachment = wp_get_attachment_image_src( $attachment_id, $thumb );?>

<a href="<?php echo esc_url( get_permalink() );?>">
	<img src="<?php echo esc_url( $attachment[0] );?>" alt="<?php echo esc_attr( get_the_title() ); ?>" />
</a>

The first step will be to change the href from the post URL to the full-size image URL. I suggest replacing those lines with:


$link = wp_get_attachment_image_src( $attachment_id, 'full' );
$attachment = wp_get_attachment_image_src( $attachment_id, $thumb ); ?>

<a href="<?php echo esc_url( $link[0] );?>">
	<img src="<?php echo esc_url( $attachment[0] );?>" alt="<?php echo esc_attr( get_the_title() ); ?>" />
</a>

Once you have done that, please test and let me know the result. Clicking the thumb image should open the same image full size in FancyBox but not the other images yet. That will be step 2: getting the post content in a hidden div…