Using page featured image as wp_list_pages link background
-
Updating a friends site so they can have more control over managing it. Previously, they would supply me with an image of the text and I would create a simple rollover (using css background-position technique).
My idea was for my friend to upload the on/off state image (using the same dimensions each time) as the page featured image. I would then add the:
<?php the_post_thumbnail(''); ?>snippet into the- and apply the CSS.
I found a function hack (This one) that would allow me to edit the output of the li as regular wp_list_pages doesn’t, however that is about the extent of my PHP abilities. Below is what I have but it’s as far as I have been able to work out.
<?php echo wp_list_pages_custom('sort_column=menu_order&echo=0&title_li=', 'tag_open=<p style="background: url(<?php the_post_thumbnail(); ?>">&tag_close=</p>&use_link=1&use_class=1'); ?>Any advice would be greatly appreciated.
The topic ‘Using page featured image as wp_list_pages link background’ is closed to new replies.