The Settings admin screens are among the first, on a fresh WordPress install, that a user will visit before they open their siteâs doors up to the public. In the Settings > Reading screen, the user is able to adjust the âBlog pages show at mostâ option. Defaulting to 10 posts per page, its left as an […]
Category: WP Tutorials
WordPress Post Date/Time & Author Meta Info
Posted on — Leave a commentTake a look at the latest default WordPress theme and youâll notice that you donât see a call for the author, date or time of any given post called directly on the relevant template. Instead, this post meta data has been distilled into a handy function. Thatâs the way to go;Â DRY! Defining the Function To […]
Register & enqueue your WordPress themeâs scripts and styles The Right Wayâ˘
Posted on — Leave a commentIf youâve been building themes for a while, and happen to have come from a HTML/CSS background, youâll remember the days when you hardcoded calls to your themeâs linked stylesheets and JavaScripts directly in the <head>. While this still works just fine, thereâs a WordPress way of doing this: by enqueuing the scripts and styles from functions.php.Enqueueing […]
Add âevenâ and âoddâ class to the WordPress post_class()
Posted on — Leave a commentYou might find the need to have alternate âoddâ and âevenâ styles for your posts. While you can define these as needed on the front end, I find it a whole lot more useful to define a function that adds these alternating classes to the post_class() function. Its quick, easy and painless. To make sure that when […]
Limit backward compatibility of your WordPress theme
Posted on — Leave a commentApproach any WordPress solution with the same ferocity designers approach the browser wars: be reasonable but also unmistakably ruthless! WordPress development seems to happen briskly and is applaudably fast. If, lets say, youâre a freelance front-end developer working in different languages and building across different platforms for your various clients and projects, by the time […]
Make that $#!% pluggable
Posted on — Leave a commentBe nice to the children When a new function arrives in WordPress and you want to make sure your theme still functions ok in older version of WP, you check to see if the function is supported first before defining it. If for some unforeseen reason you needed to build and support a theme running […]