Add thumbnail to 'my wp_list_pages' with limit and exclude
-
Hello,
I have a ‘wp_list_pages’ on my page that list other child pages with the same parent, excluding the current one. This list is also limited to 3 items. Both of these arguments are not standard ones so I’m struggling to add on a thumbnail.
Here’s my code:
<?php $limit_similar = 3; $pages = wp_list_pages("echo=0&title_li=&exclude=".$post->ID."&child_of=".$post->post_parent); $pages_arr = explode("\n", $pages); ?> <?php for ($i=0; $i<$limit_similar; $i++) { ?> <?php echo $pages_arr[$i]; ?> <?php } ?>
This works perfectly, although all it is doing is displaying them in an a very standard list.
There’s two things I’d like to do, 1) can I have more flexibility on the code that it outputs for each page? And 2) can it include the page thumbnail for each one please?
Thank you!
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Add thumbnail to 'my wp_list_pages' with limit and exclude’ is closed to new replies.