-1

Ok, I have hit a bit of a roadblock. I have a page that has been set to display the posts (which have their own featured images). I tried calling the posts featured image in the loop (which worked), and seperately calling the pages' featured image but it is still displaying the posts featured Image. Is there a way to pull both?

  • 3
    please also insert your code – terminator Feb 24 '16 at 21:52
  • 1
    This is impossible to answer without knowing your code. – Pieter Goosen Feb 25 '16 at 5:33
1

Wordpress loop functions depend on the global variables, so you will have to get the data from page before you run the loop.

Generally, you should be able to do something like this-

$page_id = get_the_ID(); //this is important, we will use this later

while(have_posts()): the_post();
//do something with the post here

echo get_the_post_thumbnail( $page_id ); //this is the page featured image

//still displaying any post related data
endwhile;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.