by Molly Roberts | Jun 1, 2022 | WordPress Code Snippets
Do you want to change the default FROM Name WordPress uses in the emails? This includes notification emails WordPress sends you and all other users on your website. It also includes the FROM name WordPress might use in a contact form. Add this code to your...
by Molly Roberts | May 31, 2022 | WordPress Code Snippets
If you are building a plugin or a custom WordPress site, for certain pages, you might want to check if the user is logged in. This way you can restrict pages to registered users. The code is really simple: if ( is_user_logged_in() ) { // The user is logged in… }...
by Molly Roberts | May 31, 2022 | WordPress Code Snippets
Do you want to display a list of all the categories on your WordPress site? You can use this code to display a list of all the categories anywhere you want in your theme. If you want to customize the look of this list, you might want to take a look at the reference...
by Molly Roberts | May 30, 2022 | WordPress Code Snippets
If you use excerpts on your WordPress site, you might have noticed that some of them end abruptly and don’t look good. Here’s an easy way to add three dots (…) at the end of every excerpt on your blog. If an excerpt looks like this right now: Lorem...
by Molly Roberts | May 30, 2022 | WordPress Code Snippets
WordPress allows adding captions to the images you upload. These captions are displayed under their respective images in a small font. Although captioning can help better describe images you use in your blog posts, you might want to disable them completely. Copy and...