by Floyd Hartford | Oct 31, 2022 | PHP, Website Development
One of WordPress’ most powerful features are page templates. Not to be confused with actual posts and pages — also commonly referred to as content types or post types — WordPress page templates are the literal files that are used to render a...
by Floyd Hartford | Aug 12, 2022 | PHP, Website Development
Learn how to remove srcset from wp_get_attachment_image() for WordPress, so you can display consistently sized attachment images every time. wp_get_attachment_image() is WordPress’s built-in function to create an <img /> tag, so you can display a media file...
by Floyd Hartford | Aug 12, 2022 | PHP, Website Development
Obligatory throat clearing… I want to include dynamic sidebars in WordPress page templates. Context When creating a “Page” in WordPress you have the option to assign a page template. Page templates allow you to apply a custom layout to a page....
by Floyd Hartford | Aug 7, 2022 | PHP, Website Development
Out of the box, WordPress does not include a async or defer attributes on javascript files loaded using wp_enqueue_script(). That’s okay, but some scripts you need them. Learn how to add async and defer attributes to WordPress enqueued script tags via...
by Floyd Hartford | Jul 29, 2022 | PHP, Website Development
It’s common for WordPress sites to create post URLs with a base slug — like /blog/%postname%, where /blog/ is the base of the slug (i.e. the URL). A lot of WP sites are websites first and blogs second. Unfortunately, when you’re using a base slug and...
by Floyd Hartford | Jul 28, 2022 | PHP, Website Development
Not always, but sometimes when you’re using WordPress for blogging, publishing articles, or other types of content-driven purposes it’s nice to render a post’s category — or categories — on the screen. Inherently, displaying a...