Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author David Aguilera

    (@davilera)

    Hi @savagepriest.

    Yes, it looks like you’ll have to tweak your theme. In particular, you must find where that HTML is printed (functions.php or single.php or archive.php or any other helper file) and tweak it.

    For example, this other ticket contains an example of how the theme prints a featured image. My reply describes how you can “overwrite” that behavior and show an external featured image (if any) instead.

    Plugin Author David Aguilera

    (@davilera)

    It’s been two weeks since OP shared his question. I’ll mark this topic as resolved.

    Neeshu

    (@neeshu)

    Thanks I will try that David if it works it will surely be a great benefit and I will be forced to make a small donation for your great work.
    Thanks god bless.

    Thread Starter savagepriest

    (@savagepriest)

    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;
    			}
    
    		}
    }
    Thread Starter savagepriest

    (@savagepriest)

    hi, can you take some money and fix my site please.
    I am unable to put the code in there.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Does not work on my Twenties theme please help’ is closed to new replies.