Where can i define post picture default size to some defined height and width in dwfocs theme,
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 !
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>
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 !
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.
please send me your site for further checking.
Please login or Register to submit your answer