Articles of theme development

How to prepare the HTML for WordPress

Right now I’m finishing a design in Photoshop and I’m about to turn it to HTML. After that I’m want to turn it into a WordPress theme using Underscores starter theme. How can I prepare the HTML so the transition to _s would be smooth and easy without changing a lot of HTML and CSS […]

Removing non native customizer settings from a child theme

For removing settings, controls and sections of the customizer, we can just simply use the remove methods like this: function remove_custom($wp_customize) { $wp_customize->remove_setting(‘id’); $wp_customize->remove_control(‘id’); $wp_customize->remove_section(‘id’); } What I notice is that there’s no way to remove parent-theme customization, so non native customization of WordPress itself. In fact, trying to remove the blogdescription is possible. I […]

Understanding and using metaboxes in posts

I am developing my first theme that is not dependent on a parent theme but I am running into some back-end problems. I’m trying to add a metabox to all posts that are being written. This question is quite broad in that it covers quite a lot of features. So if that’s preferred I will […]

Wrong path for theme assets

I’m working on a WordPress project, starting from Mark Jaquith’s WordPress-Skeleton repository, using MAMP. I cloned the repo, updated the WordPress submodule, created a database and updated the local-config.php file. Everything seems to be fine so far, but when I try to use a different theme (placing it on /content/themes), all the theme’s assets get […]

What is the correct way to update both WP/plugins/themes without breaking the site?

We seem to get WordPress core updates/plugin updates/theme updates thick and fast and usually every day. When managing a third party WordPress, what is the best procedure to stay secure and have a fully working site, whilst ensuring a client is constantly updated? Do I run a parallel dev site and try the updates first […]

WordPress Google Maps in Custom Theme

So I’m building a custom theme and implemented the Google Map API so I can give it a cleaner feel and so on then the normal Google Map. I’ve run into a problem when implementing my Marker as I implement the marker through jQuery but I can’t seem to find a way to get the […]

The proper way to include/require PHP files in WordPress

I’m a new WordPress developer and recently I’ve been having problems (on multiple sites) with include_once and require_once for PHP files. If I include (get_theme_directory_uri() . ‘subdir/file’) the specified file gets included (or required, which leads to fatal errors) but if any WordPress functions are called within ‘file’ I get something similar to: ‘Call to […]

Set the transport of the Customizer 'header_image' core setting to 'postMessage'

To activate the Customizer core section Navigation (ID: nav), you need to: add_theme_support( ‘custom-header’ ); I already tried to make the transport of the Customizer header_image setting postMessage with the ID based on what I’m seeing at get_header_image(): function theme_customize_register( $wp_customize ) { $wp_customize->get_setting( ‘header_image’ )->transport = ‘postMessage’; // I also tried this line. // […]

Custom Theme Bootstrap

So I’ve made my custom theme using Bootstrap and everything is working all good and well expect from when I put it onto a tablet device. The problem I’m having is the Navbar doesn’t collapse when the menu and the logo go onto the same line. See Image Below: http://prntscr.com/9mewuw The thing is it collapses […]

Set a static front-page as a landing page programmatically

I am in process to create my first wordpress theme with underscores.me skeleton, the theme i would like to create its a business theme so when my theme is activated to land directly to a static front-page instead of the default wp posts. How could i do this programmatically and where to put this code […]