Reputation: 77
I'm developing a blog on wordpress, the theme is Marlene.
So, I have a post and by default the image in this post has the resolution 835x577, which is great for me (example of the post)
But I also have the page "News", in which I want to display the list of all my news posts. And in this page I need to resize the image to 400 x auto (link to news section).
The problem is that when I'm changing the size of that image then it automatically changes the size of the image inside this post (835x577).
So somehow I need to break this connection. Think I need to create second class with different width and height, but do not know how I can do it automatically in wordpres.
Hope that you could understand me and can help) Thank you in advance !!!
Upvotes: 1
Views: 859
Reputation: 302
If you want to produce a layout that is different to the default for the theme you are using, then the simplest way to do that is to create a child theme. This lets you use all the code that is in the parent theme, and you can still apply updates and security fixes to your theme, but allows you to add extra bits and pieces such as custom image sizes.
You'd add the function to the functions.php file of your new child theme.
Alternatively, if that is literally the only thing you want to do that isn't as provided by the theme by default - ie, you just want to add one line of CSS to format the image size on that one page - you could use a plugin such as Header and Footer or Add Custom CSS to just tweak that one element.
However, I would recommend using a child theme. You might only want to tweak one line of CSS now, but in a few months when you have other amends to do, having a child theme already properly set up and understanding how to use it will save you work ;-)
Upvotes: 1