Ask your WordPress questions! Pay money and get answers fast! Comodo Trusted Site Seal
Official PayPal Seal

Gallery Page WordPress

  • SOLVED

I created a one column gallery page but I'm having trouble with codes. My theme is Twenty Eleven.

In the content-gallery.php, instead using the default thumbnail, I placed this code for a bigger thumbnail at 640 x 427.

<a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'twentyeleven' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark">
<?php the_post_thumbnail('post-thumb');?></a>


On the right side, I want the content post ( text only) to be placed and there is a photo in set with only 4 thumbnails. I placed this code but all of the thumbnails in that post/album are there. This is the code,

<?php echo do_shortcode('[gallery size="small-thumb" columns="2" link="attachment"]'); ?>

This is the screenshot I want to happen.

I hope someone can help me to solve it. Thank you.

Answers (3)

2012-09-06

Dbranes answers:


[[LINK href="http://wordpress.org/support/topic/maximum-limit-number-of-images-in-gallery-shortcode#post-1527379"]]Here[[/LINK]] is clever a way to limit the number of images in a gallery

You could use this to limit the number of images to 4.


Dbranes comments:


Here is a detailed description about the new gallery on ma.tt :

[[LINK href="http://ottopress.com/2011/photo-gallery-primer/"]]http://ottopress.com/2011/photo-gallery-primer/[[/LINK]]


ps: Matt has also released his 2 older themes:

"if you’re one of the thousands of people who’ve asked me how I do my galleries here on this site, now you can look at the actual code in the Matala theme."

http://ma.tt/2010/08/new-themes/

Hope this helps.


wpqanda comments:

Wow, looks likes this one will work. I'll let you know later tonight. Thanks! ;)

2012-09-06

Arnav Joy answers:

so your problem is that small thumbnails are not visible?


Arnav Joy comments:

can you show me the code of content-gallery.php


Arnav Joy comments:

have you registered these

size="small-thumb" and "post-thumb"

using add_image_size() function?


wpqanda comments:

They are visible but it shows everything from the album or from the post itself.

The default content is also in excerpt that means some of the html are not allowed. I will limit the text content but I would like to appear the link in hyper. View the attached for screenshot. That is exactly what I want.


Arnav Joy comments:

can you show the url?


wpqanda comments:

My gallery page test is a mess right now. You can base the Twenty Eleven theme using child theme. Yes, everything is set in the function.php.

2012-09-06

Asad Iqbal answers:

Can you please paste the code of the page you give the screenshot?

Look at function reference of to get content:
http://codex.wordpress.org/Function_Reference/the_content

And get content by post ID:
http://wordpress.stackexchange.com/questions/9667/get-wordpress-post-content-by-post-id


wpqanda comments:

I photoshop the screenshot but I got the whole idea from here this site [LINK href="http://ma.tt/gallery/"]