[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now


How to customize WordPress with HTML, CSS,  Javascript, PHP, etc.

Posted on 2014-04-01
Medium Priority
Last Modified: 2014-04-02
I have been developing websites with HTML, CSS, Javascript, PHP, etc. for many years and consider myself competent with them.

Recently, I have setup several WordPress websites for clients using purchased themes. I have mostly just used the tools that come with the themes, such as the included shortcodes, styles, etc.

Because so many clients are calling for WordPress, I need to get up-to-speed on how to customize these sites. The end result is always just HTML, CSS and Javascript (it is my understanding), so anything doable with code *should* be doable with WordPress, correct? Here are a few examples of the types of things I would like to learn:

(1) A task that normally I would accomplish using PHP and a database, how to do the same in WordPress? Such as taking a user input, doing a database lookup, and displaying results on a page.

(2) I want to do a completely customized page design. Should I start with an existing theme (basic theme, purchased theme, "naked" theme?) and build from there, or must I develop my own theme from scratch?

(3) I like the fact that many themes are already responsive (desktop, tablet, smartphone, etc.), how can I leverage that but still do my own completely custom design/layout?

(4) I want to start with an existing theme but do a lot of custom CSS.

(5) I want to add my own Javascript to an existing WordPress site.

I am hoping someone with experience doing these kind of things can steer me in the right direction. I don't want to hack a WordPress site to pieces, I want to use best practices.

Must I look into theme development? Developing my own plug-ins? Creating my own shortcodes? In which cases is it OK to override an existing theme's code (CSS, Javascript, etc.) being aware that a theme upgrade could cause problems later? Is that even a best practice?

Coming from developing in pure code, it is difficult for me to get used to all the menus and options. So that has been a bit of a challenge. I guess I basically need to understand how WordPress works, how to customize it, etc., beyond just being a point-and-click, drag-and-drop WordPress developer.

It also seems like for accomplishing any task, the go-to solution is always to look for an existing plug-in before doing any programming. But there must be cases where writing your own code is the better way to go.

I am not looking for specific instruction on how to do the above items necessarily, but perhaps articles, online tutorials, a book, etc., for someone who is in my position? There must be others like me out there.

Thank you!
Question by:bbdesign
  • 2
LVL 38

Accepted Solution

Tom Beck earned 2000 total points
ID: 39970574
About six months ago I was were you are now with regards to Wordpress so I'm still just a beginner. I've learned a lot in that time and am confident that I can customize a Wordpress site to any degree I choose AND not worry about it all falling apart on the next upgrade of the WP core. I'm even writing my own plugins. I've also taken plugins that are close to what I want and modified them to suite my needs.

(1). You could do all of your PHP coding for database access the same way you've always done it and it would work in WP (such as using mysqli queries, fetch_assoc, etc.). But WP has so many useful functions that shortcut the process. Look here.. Use custom page templates and code however you like (see below).

(2) (3) (4). Start with an existing theme that has the responsive features you like and create a child theme from it. Then, if the original theme is updated, your modifications are safe. Look here.

(5). There are several ways to inject javascript code on the page. Look at the add_action and add_filter functions but generally get a thorough understanding of the concept of "hooks" in WP. Lots of links like this one on the web.

Also look into creating custom page templates. By using this technique, you can completely isolate your customizations from the WP core. Any upgrade to the core and you're safe. With custom page templates you have complete control over how the content for your pages is displayed and where it's coming from in the database while the theme and core files manage the shell (wrapper containers, menus, banners, etc).

Just finishing up a WP site now and really the only things "WP" about it are the authentication functionality and Dashboard interface (which I have also modified to my liking). I've removed the sidebars, comments, and the whole "blog" centric aspect of WP. I did not want a "blog" site.

Author Comment

ID: 39971012
Thanks man, this is exactly the kind of intro I needed. Hopefully in six months or less I'll be banging out custom WP sites like you. Cheers!
LVL 38

Expert Comment

by:Tom Beck
ID: 39971962
Awesome, thanks both.

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

WordPress can be pretty daunting, especially for a beginner, so I thought it might be a good idea to write an article to show how easy it is to get started in WordPress and to design a custom theme.  The first step is to check with your hosting comp…
WordPress is constantly evolving, and with each evolution appears to get better and better.  One of the big drawbacks prior to version 3 was that there was no way to be able to set up a custom menu from the backend. The Old Way Adding menus is…
The purpose of this video is to demonstrate how to Import and export files in WordPress. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp-login.php : Click on Too…
The purpose of this video is to demonstrate how to set up basic WordPress SEO. This will be demonstrated using a Windows 8 PC. The plugin used will be WordPress SEO by Yoast. Go to your WordPress login page. This will look like the following: myw…

872 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question