Notice: Function wp_enqueue_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the codepen-embed-script handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.) in /home/jwblogger/jwBlogger/wp-includes/functions.php on line 6114

Warning: Cannot modify header information - headers already sent by (output started at /home/jwblogger/jwBlogger/wp-includes/functions.php:6114) in /home/jwblogger/jwBlogger/wp-includes/rest-api/class-wp-rest-server.php on line 1893

Warning: Cannot modify header information - headers already sent by (output started at /home/jwblogger/jwBlogger/wp-includes/functions.php:6114) in /home/jwblogger/jwBlogger/wp-includes/rest-api/class-wp-rest-server.php on line 1893

Warning: Cannot modify header information - headers already sent by (output started at /home/jwblogger/jwBlogger/wp-includes/functions.php:6114) in /home/jwblogger/jwBlogger/wp-includes/rest-api/class-wp-rest-server.php on line 1893

Warning: Cannot modify header information - headers already sent by (output started at /home/jwblogger/jwBlogger/wp-includes/functions.php:6114) in /home/jwblogger/jwBlogger/wp-includes/rest-api/class-wp-rest-server.php on line 1893

Warning: Cannot modify header information - headers already sent by (output started at /home/jwblogger/jwBlogger/wp-includes/functions.php:6114) in /home/jwblogger/jwBlogger/wp-includes/rest-api/class-wp-rest-server.php on line 1893

Warning: Cannot modify header information - headers already sent by (output started at /home/jwblogger/jwBlogger/wp-includes/functions.php:6114) in /home/jwblogger/jwBlogger/wp-includes/rest-api/class-wp-rest-server.php on line 1893

Warning: Cannot modify header information - headers already sent by (output started at /home/jwblogger/jwBlogger/wp-includes/functions.php:6114) in /home/jwblogger/jwBlogger/wp-includes/rest-api/class-wp-rest-server.php on line 1893

Warning: Cannot modify header information - headers already sent by (output started at /home/jwblogger/jwBlogger/wp-includes/functions.php:6114) in /home/jwblogger/jwBlogger/wp-includes/rest-api/class-wp-rest-server.php on line 1893
{"id":390,"date":"2018-05-03T09:32:14","date_gmt":"2018-05-03T16:32:14","guid":{"rendered":"http:\/\/blog.jeffwilkerson.net\/?p=390"},"modified":"2018-05-03T09:32:14","modified_gmt":"2018-05-03T16:32:14","slug":"a-better-way-to-build-with-wordpress","status":"publish","type":"post","link":"https:\/\/blog.jeffwilkerson.net\/2018\/05\/03\/a-better-way-to-build-with-wordpress\/","title":{"rendered":"A better way to build with WordPress"},"content":{"rendered":"\n
\n
\n

I have a love hate relationship with WordPress. I love that it is responsible for so much web content. I love how it has been a pioneer for content management systems, making it easier for your average human to publish content to the web. I love the fact that I\u2019ve had many projects that leveraged WordPress, and that I played a small role in helping my clients do business.<\/p>\n\n

But from a technical and professional perspective, WordPress is frustrating to work with. As a front end developer, who likes to have control over HTML and layout containers, I find it difficult to develop creative solutions to unique problems.<\/strong> Sure WordPress is very extensible \u2013 there are tons of free plugins and themes that can extend WordPress and ensure no two WordPress sites will be the same. But that also means that a WordPress site can easily become bloated with an entangled mess of codependent code, putting the site at risk of slow load times, data errors, and even hacks.<\/p>\n<\/div>

\n
\"\"<\/figure>\n<\/div><\/div>\n\n\n

<\/p>\n

Let me explain….<\/h2>\n

In my WordPress development experiences, ambiguity is a recipe for disaster. Yes, ambiguity is a factor in any project, but it seems to be much less manageable on WordPress projects. Unless the design of a website has been fully flushed out – all the layouts, all the content containers, all the look and feel of buttons and form inputs – unless all of that has been flushed out and agreed upon by the client before any code is written, the project will face ambiguity. Sure, part of my job as a developer is to be able to handle that ambiguity gracefully. I have to be flexible, and build the project carefully, and anticipate changes that might come in the 11th hour of the project. However, I’ve always found it difficult to be flexible in WordPress projects.<\/p>\n

I often wonder is it possible to build a WordPress site using a modular design approach?<\/p>\n

Modular Programming<\/h2>\n

As a kid, I liked building with Lincoln Logs and Legos1<\/a><\/sup>. I like building one piece at a time, then merging the independent pieces at the end. I like to build websites in a similar way. By breaking a website project down to a group of independent modules (such as navigation, form elements, article layouts, etc.), I create the flexibility needed to anticipate changes in the design, or unforeseen UI\/UX hiccups that no one considered when the project started.<\/p>\n

I avoided WordPress for the longest time because it was just too time consuming to make a site flexible enough to evolve over time. Most of my WordPress development was fixing broken elements, cleaning up code bloat, or scrapping hours of work and starting from scratch after the client suddenly decided to do something different. Sometimes I would spend months developing a site only to have it break a few weeks after launching because of some automatic update, or the client tried to do something I didn’t anticipate. These are common obstacles when developing any website, but when dealing with WordPress, these obstacles were a nightmare. WordPress development did not feel like building with Legos, it felt like trying to stay afloat in a sinking ship.<\/p>\n

My point is, WP is a great tool when working with small websites, but its difficult to do unique and creative work, which isn’t fun. I’d like to continue using WordPress, given its popularity, but I also want to enjoy performing the work I do, and thats difficult to do when using WordPress. Specifically, as a developer using WordPress, I find it difficult to:<\/p>\n

– Manage CSS, both global styles and page\/widget specific styles.
– Manage script and style includes. I mean, why should I have to load assets for Contact Form 7 on every page if theres only one page containing a form?
– Create and extend page templates. I’m an HTML enthusiast. I don’t want to drown in a bunch of PHP templates and functions and hooks just to get the HTML I want.
– And don’t get me started on custom fields and custom post types. I am so grateful for plugins like ACF and CPT because I still have nightmares about trying to create custom WP sites without those tools.<\/p>\n

I could go on and on here. I don’t mean to complain, all content management systems are quirky and no CMS will please everyone.<\/p>\n

WP is constantly improving, and most importantly, is free. For that I am thankful. However, given the popularity of WordPress, I cannnot avoid it, and that makes me frustrated. I am a Front End Developer. I want to write clean HTML, Javascript, and CSS, and build useful web interfaces that create value for my clients. I like PHP, but I don’t want to live in it. Can I do that using a CMS that is also easy to use for the end user? I am sure I am not the only front end developer who wonders about a better developer-friendly way of working with WordPress<\/p>\n

Further Reading and References<\/h2>\n

About Using Modular Approach in Front End Development<\/p>\n