Dear David
thanks for the help I found this code in my theme function folder /functions/featured-image.php can you please help with the below code where should I inser the code suggested by you.
<?php
/**
* Returns a post featured image URl
* @package WordPress
*/
// Returns the site featured image
if ( ! function_exists( 'wpex_image' ) ) {
function wpex_image( $return = 'url', $id = '', $custom_query = false ) {
// Post Vars
global $post;
$post_id = $post->ID;
$post_type = get_post_type( $post_id );
$attachment_id = $id ? $id : get_post_thumbnail_id( $post_id );
$attachment_url = wp_get_attachment_url( $attachment_id );
// Resizing Vars
$width = '9999';
$height = '9999';
$crop = false;
/**
Pages
**/
if ( $post_type == 'page' && is_singular( 'page' ) ) {
$width = '9999';
$height = '9999';
}
/**
Standard post
**/
if ( $post_type == 'post' ) {
// Single Posts
if ( is_singular() && !$custom_query ) {
if ( wpex_sidebar_display() ) {
$width = get_theme_mod( 'wpex_post_img_width', '670' );
$height = get_theme_mod( 'wpex_post_img_height', '9999' );
} else {
$width = get_theme_mod( 'wpex_full_post_img_width', '1020' );
$height = get_theme_mod( 'wpex_full_post_img_height', '9999' );
}
} elseif ( is_singular() && $custom_query ) {
$width = get_theme_mod( 'wpex_related_entry_img_width', '210' );
$height = get_theme_mod( 'wpex_related_entry_img_height', '120' );
} else {
// Entries
$width = get_theme_mod( 'wpex_entry_img_width', '670' );
$height = get_theme_mod( 'wpex_entry_img_height', '9999' );
if ( '1' == wpex_grid_columns() ) {
$width = get_theme_mod( 'wpex_full_post_img_width', '1020' );
$height = get_theme_mod( 'wpex_full_post_img_height', '9999' );
}
// Blog template
global $wpex_entry_columns;
if ( '1' == $wpex_entry_columns ) {
$width = '1020';
}
}
}
// Return Dimensions & crop
$width = intval($width);
$width = $width ? $width : '9999';
$height = intval($height);
$height = $height ? $height : '9999';
$crop = ( $height == '9999' ) ? false : true;
$resized_array = wpex_img_resize( $attachment_url, $width, $height, $crop, 'array' );
if ( 'url' == $return ) {
return $resized_array['url'];
} elseif ( 'array' == $return ) {
return $resized_array;
}
}
}