You're browsing the category: Tutorials

Tutorials and snippets related to programming: Wordpress, HTML, CSS, jQuery, you name it.

Tutorials

WordPress: Setting up featured images

You’ll find that most blogs that use WordPress as their blogging platform use featured images on their posts. Featured images are what you usually see when you share a post on social media (the thumbnails that appear when sharing on Facebook or Google+), related posts widgets and in the post itself.

It’s really simple to add the featured image functionality, if you don’t have it already. You just have to modify one theme file and you’re done.

Open your current theme’s functions.php file

The functions file contains all the snippets necessary to make sure the theme runs correctly and to add any custom modifications to your theme.

Add the next snippet to your functions file

By adding that code, you should have the featured image functionality. When you write a post, you should be able to see the ‘Featured Image’ box to your right. With a prompt to add an image.

Tutorials

WordPress: Visual Editor Stylesheet Modification

Have you ever wondered how to style the WordPress Visual Editor (when writing posts) using your current theme’s functions file? Well, lucky for you there is a way to do that!

You can edit quite a lot with this function: typefaces, font size, image styling, and so much more. All it takes is to create a separate stylesheet and add a small function to your theme’s functions.php file.

Add to your theme’s functions.php file:

¬†Create ‘visual-editor.css’ and add your custom CSS

Add all the CSS you want to use that you want to see on your WordPress Visual Editor. For example, on this blog, I made one just to increase the font size of the Visual Editor. So I did something like this:

Note: You can name the file whatever you want, just make sure to use the correct filename on the PHP function. Also, upload the CSS file to the same directory where your theme’s style.css is.

And voila! Now you have more ways to customize the WordPress interface to your liking. If you have any questions, please let me know by leaving a comment.