Some doubts about gallery shortcode in WordPress


Warning: Attempt to read property "ID" on null in /home/u522501990/domains/readforlearn.com/public_html/wp-includes/media.php on line 2777

If you want to display the attached image gallery, from another post, you can use:


where the custom id attribute is the post ID.

If you want limit the number of items in a gallery, there seems to be a plugin available on wordpress.org called Limit parameter for gallery shortcode (no affiliation). It uses the pre_get_posts filter to change the posts_per_page and offset attributes of the get_posts() or get_children() calls in the gallery shortcode callback.

Example:


Leave a Comment

techhipbettruvabetnorabahisbahis forumuedueduedueduedueduseduedusedusedus