Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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
add comment

1 Answer 1

You are offered to use:

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

instead of:

get_thumbnail($width,$height,$classtext,$titletext,$titletext,false,'Pageimage'); 

and then process this meta value.

share|improve this answer
add comment

Your Answer

 
discard

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.