Modifying Image size for the home page – WordPress

virantcms I have done some modification for the current theme home page. I am showing the content till the Read More.. The problem what I was facing was the size of the images. I have written a function which resizes the image according to the image page design. We do not need to bother about the size of the image when we do the post.

First We need some function to find the height and width of the posted image and then resize the image according the size ratio so that images don’t look odd.

Then we modify the content using the following function

Now we call this function to print the modified content

I am using the VibrantCMS theme

A part time blogger, WordPress Developer and the Author of this blog.

Leave a Reply

Follow

Get every new post delivered to your Inbox

Join other followers: