WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Im working on my Wordpress website, and I'm having an issue with the page template inserting the "Featured Image" at the top of the page. I've isolated the PHP code that controls this.

    $thumb = '';
    $width = (int) apply_filters('et_page_image_width',621);
    if ( is_page_template( 'page-full.php' ) || $fullwidth ) $width = (int) apply_filters('et_page_image_full_width', 960);
    $height = (int) apply_filters('et_page_image_height',320);
    $classtext = '';
    $titletext = get_the_title();
    $thumbnail = get_thumbnail($width,$height,$classtext,$titletext,$titletext,false,'Pageimage');
    $thumb = $thumbnail["thumb"];

Now if I delete this code it will remove the image at the top of the page, which is fine but I want to replace it with an image from the media library. Is it possible to change the code so that it pulls the image from the "Edit Page>Custom fields" section in the Wordpress page editor?

Thank you for the help.

share|improve this question

You are offered to use:

get_post_meta($post_id, $key, $single); 

instead of:


and then process this meta value.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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