Lisa geni
asked 9 years ago

Where can i define post picture default size to some defined height and width in dwfocs theme,

2 Answers
DominicStaff
answered 9 years ago

Hi, If you want to define post picture default size to some defined height and width in DW Focus theme, you can open the wp-content\themes\dw-focus125\inc\init.php file. Find the line 41. Add the following code: add_image_size( 'single-thumb', 220, 180, true ); // (cropped)

Note: You can refer here: https://codex.wordpress.org/Function_Reference/add_image_size

After adding code, you can find the line code: <?php the_post_thumbnail(); ?>

Then replace it with the following code: <?php the_post_thumbnail('single-thumb'); ?> Hope this helps !

Lisa geni
answered 9 years ago

Thanks ,Sorry I asked twice this question. I am not able to find the init.php file in my dwfocs theme folder , And my question is in somewhere it has defined with this size of the thumbnail where can i find and changes to add my height and width .

<div class="entry-thumbnail"> <img width="650" height="364" src="" class="attachment- wp-post-image" alt="VC1 (1)"> </div>

dominic Staff
replied 9 years ago

Of course, I have provided a solution to change the with & height of the image in the previous answer. If you can not to find the init.php file, you can use the following code to change the image size:

  • This code to change the image size in the single page.
    .single #main>.post .entry-thumbnail img {
    width: ...px;
    height: ...px;
    }

    Note: Please add this code to the style.css file (log in to Dashboard > Appearance > Editor > style.css).
    Hope this helps !

lisageni
replied 9 years ago

Exacly what i am looking for , but it not works for all the images , For many images width and height are different ,
If i have 1200 * 800 px of image size still it display the same size in single post view.

dominic Staff
replied 9 years ago

please send me your site for further checking.

Powered by DW Question & Answer Pro