You know what’s annoying? When you switch your WordPress theme but none of your old posts match your new design. You have images that no longer match, headings that are the wrong colours and fonts, etc.
Luckily, there are two great ways to ensure a seamless transition between WordPress themes!
Don’t use inline CSS
This is the #1 way that your posts will look wonky across different themes. If you use inline styles to apply certain colours and fonts, those same colours and fonts will carry over to your next theme, but this time they may not match the design!
Do not do this:
<h2 style="color: #f13636; font-family: Arial, sans-serif; text-align: center;">My blog header</h2>
This is using inline CSS to change the font colour, family, and center the text. But what if you don’t want your h2 tag to be red in the next theme?
Use an external stylesheet instead
You can add your HTML to your post with the plain h2 tag.
<h2>My blog header</h2>
Then, in an external stylesheet (you can use a plugin like Simple Custom CSS to get one of those), you can style that h2 tag however you want. This will apply the styles to all h2 tags.
h2 { color: #f13636; font-family: Arial, sans-serif; text-align: center; }
The beauty of using this method is that when you switch themes, all you have to do is edit the CSS in one place—your external stylesheet. Then the changes will be applied to all your posts automatically.
h2 { color: blue; font-family: Georgia, serif; }
That’s a lot better than having to go back and edit the code in every single post, isn’t it?
Use dynamic featured images
This is definitely a more advanced recommendation, as it requires custom PHP code and either modifying your theme, creating a custom child theme, or creating your own theme from scratch.
Dynamic featured images are handy if you have a regular feature that always uses the same header image. This won’t work if you always upload different images each time. But if you always use the same banner for Waiting on Wednesday posts, then it’s perfect!
The gist of it is: you create a featured image banner for a specific WordPress category that matches your current blog design. Then, in the code, you use logic like this:
- Check what category this post is in.
- Check to see if I have a featured image for that category.
- If I do, add the featured image before the post.
Since you’re not uploading the image directly to the post, then you can easily change this image when you create a new blog design. Then, the image is automatically updated on every single post it’s used on. Nify, huh? This is a great way to keep images consistent with your design, and then easily update them when your design changes.
I’ve already written a dynamic featured images tutoroial, so if you’re up for a little coding, go check it out!
A cohesive blog will make a good impression
- When you’re formatting your posts, ask yourself if you can use this same formatting method in another theme. If you can’t, then it might actually break old posts if/when you switch themes in the future.
- Think about how you write your blog posts. Do you use a lot of different HTML tags?
- If you ever insert/change colours manually inside a post, think twice! Those colours will look out of place on a future theme or different design.
This is a wonderful piece, Ashley! If I ever do a redesign and I’m going to learn how to code, I would definitely be going to incorporate dynamic images into it.
I particularly love dynamic images. 🙂 I added them to my own theme about a year ago or so, and they’re awesome! Plus they make my life so much easier, because I can write a post without having to create an image, since I already have a generic one being added automatically.
#lazy
Love the post!
You should do a course about coding (HTML. etc…), in levels, “basic”, “advanced”… and after to make plugins in wordpress 😀
Haha, I’d love to! That’s a lot of work/content to write up though. 😉 I am planning on launching an “intro to HTML/CSS” e-course sometime over the next few months. I just haven’t had time to work on it yet.
What makes me happy about the time waiting…is that i have a change to get the money on time and be your student 😀 i would love to know code and make plugins 😀
Woo-hoo! Something I’m actually doing right! *happy dance* I think that’s only because everything I do with design code I learned here and you always go to the theme, not the post – so I guess I never even thought that was an option. Dumb luck, but I’ll take it 😛
Awesome job, Berls! And that’s absolutely right. You should divide markup (HTML, posts) from style (CSS, theme).
I did this when I was on Blogger and I had no idea what this was. I then moved to WordPress and i learnt about it and it’s the BEST THING EVER. It’s so easy to change things through CSS and have it influence all your posts instead of having to go back and edit them individually.
This is a fantastic article and very informative, thank you for the tips and advice for a new blogger.
This is something I haven’t thought about before, but after reading your post it makes perfect sense. Thanks for the tips!!