-
TSOPParticipant
Hi,
Could you confirm if the following is a bug or if I am doing something wrong?
I post an article as a ‘gallery post’, then when it shows up in between all the other posts, the, let’s say, ‘featured image’ is a collection of a couple of pictures from the gallery. Which is all fine so far. However, when you click on this little picture (instead of the title) it pops up huge in some kind of preview showing the pictures that are used as ‘featured image’. Even from other galleries. It is hard explain, so perhaps you can take a look for yourself: http://www.thespinoffproject.com/category/being-an-artist/
In short, I would think that when someone clicks on the post image, it should bring them to the post, not open a preview of a collection of ‘featured post images’ from all the galleries that one has.
One other thing: would it be an idea/possibility to within the gallery add the words ‘previous’ and ‘next’? I believe it is quite confusing at the moment, I do not think people get that they have to click on the images below to go forward through a gallery.
Thank you. Your help is very much appreciated.
Daniel TaraKeymasterYes, that is the intended behavior of the gallery post format. If you want to direct the images to the post you’ll have to edit functions.php inside the function pinboard_post_image() replace this line:
<a href="<?php $image = wp_get_attachment_image_src( $attachment- rel="nofollow">ID, 'full' ); echo $image[0]; ?>" class="colorbox" title="<?php echo esc_attr( get_the_title( $attachment->ID ) ); ?>" rel="attachment">
with this:
<a href="<?php the_permalink(); ? rel="nofollow">" class="colorbox" title="<?php the_title_attribute(); ?>" rel="attachment">
- This reply was modified 10 years, 5 months ago by Daniel Tara.
TSOPParticipantThere is no such line:
<a href="ID, ‘full’ ); echo $image[0]; ?>” class=”colorbox” title=”ID ) ); ?>” rel=”attachment”>
So, makes it hard to replace it ..
TSOPParticipantThis is how the function pinboard_post_image() in functions.php looks like:
1814 function pinboard_post_image() {
1815 if( has_post_thumbnail() ) : ?>
1816
1817 <a href="” title=”” class =”colorbox” rel=”attachment”>
1818
1819
1820I would really appreciate if you could modify it and send it back to me so that I can replace the original one with your version.
TSOPParticipant`1814 function pinboard_post_image() {
1815 if( has_post_thumbnail() ) : ?>
1816 <figure>
1817 <a href=”<?php $image = wp_get_attachment_image_src( get_post_thumbnail_id(), ‘full’ ); echo $image[0] ?>” title=”<?php the_title_attribute(); ?>” class =”colorbox” rel=”attachment”>
1818 <?php the_post_thumbnail( ( pinboard_is_teaser() ? ‘teaser-thumb’ : ‘image-thumb’ ) ); ?>
1819 </a>
1820 </figure>It already says that. Can you please modify the code and put the changes in red or something? It is not clear what you mean.
Daniel TaraKeymasterYou need to replace
$image = wp_get_attachment_image_src( $attachment- rel=" nofollow"="">ID, 'full' ); echo $image[0];
withthe_permalink();
and removerel="attachment"
andclass="colorbox"
TSOPParticipantHello,
The code you want me to replace is NOT in functions.php. Please have a closer look into the code I provided in my previous comment, there is no line with:
$image = wp_get_attachment_image_src( $attachment- rel=" nofollow"="">ID, 'full' ); echo $image[0];
Thanks.
Tagged: gallery
You must be logged in to reply to this topic.