WordPress 5 will come with a new editor called »Gutenberg«, which is completely different from the current TinyMCE. That does not only mean change for the users, but also for theme developers, who want to modify editor styles, so it looks like in the frontend. This post shows you how that works for the new editor. Continue reading Creating theme editor styles for Gutenberg
Like adding a product via the REST API is creating a product variation done relatively quickly – I use the PHP library for that, like in my last week’s post. Continue reading Creating a WooCommerce product variation with the REST API
WooCommerce comes with a REST API that, for example, allows us to create products. Here I show you how to do this. Continue reading Creating a WooCommerce product with PHP via the REST API
Since WordPress 4.6 it is relatively simple to add validation to customize settings, to give helpful error messages to the user. Here I show you how that works. Continue reading Validating customize settings with displaying error messages
When creating a customize section, you define a title for it. Sometimes it can be useful to change this title during a customize session, for example, to reflect the value of a control, like the GIF shows:
I did not find a solution for that via the Customize JS API, so there was only the way via manipulating the DOM directly. Continue reading Change title of customize section
Sometimes it can be helpful to close a section in the WordPress Customizer, for example, after a button was clicked. If you know how to do it, it is really easy to do, but I searched for a while recently until finding the solution.
With this one-liner you can close a section:
hannover_portfolio_archive_page_options is the ID of the section you want to close.
In the upcoming version of my Hannover theme, there should be an improved user experience in the Customizer besides a reworked design and code base. Among other things, the user should be able to remove sections with a button click (like known from removing a menu in the customizer). After that, not only the section should be removed from the customizer, but also the corresponding theme mods need to be removed from the database. This post shows my solution for that. Continue reading Remove theme mod after button-click in the customizer
My article from last week was about creating panels, sections, and controls with the JS API of the customizer. This post describes how to register settings with the Customize JS API, which usually are created via the PHP API. Continue reading Creating settings with the Customize JS API
Until now I mostly used the PHP API of the customizer. Since Weston Ruter’s post about the improvements of the Customize JS API in WordPress 4.9, I wanted to change that and learn more about the Customize JS API. This post shows you how to create panels, sections, and controls with that API. Continue reading Creating panels, sections, and controls with the Customize JS API
While building the »pay what you want« solution for my shop last week, I needed to tinker a little bit to get the particular plugin working, because I do not use the product page of WooCommerce but the single view of an own custom post type to display the buy option. Continue reading Show add to cart template on no-WooCommerce template