WordPress Developer Ukraine, Kyiv
WordPress add_post_type_support(): Add or Remove Features from Any CPT at Runtime

WordPress add_post_type_support(): Add or Remove Features from Any CPT a ...

add_post_type_support(): add or remove features of any post type What a post type offers in the editor (title, editor, excerpt, featured image, comments, revisions, custom fields) is defined by its “supports”. For your own post types you set them in register_post_type(); for post types of core and plugins, add_post_type_support() and remove_post_type_support() change them later. Supports…
CSS Grid layout fundamentals for WordPress theme developers

CSS Grid layout fundamentals for WordPress theme developers

CSS Grid layout basics for WordPress theme developers For years theme layouts were built with floats or with the Bootstrap 12-column grid. Both work for equal columns, but anything asymmetric means nested rows, offset classes and clearfix hacks. CSS Grid works in two dimensions at once, rows and columns, so one rule on the container…
Enqueue scripts and styles correctly in WordPress

Enqueue scripts and styles correctly in WordPress

Enqueue scripts and styles correctly in WordPress Adding JavaScript and CSS with <script> and <link> tags right in header.php is one of the most common mistakes of developers who come to WordPress from static HTML. It works, but it bypasses the WordPress asset system: no dependencies (your script may run before jQuery), duplicates (a plugin…
WordPress Term Meta: add_term_meta, get_term_meta, and Custom Fields for Categories

WordPress Term Meta: add_term_meta, get_term_meta, and Custom Fields for ...

Term meta: custom fields for categories, tags and custom taxonomies Since WordPress 4.4 terms have their own meta table, and add_term_meta(), get_term_meta(), update_term_meta() and delete_term_meta() work like their post counterparts. Before that, plugins kept term data in options with keys like category_12_image. Term meta is the place for data that belongs to the term itself:…
Add custom columns to WordPress admin posts list

Add custom columns to WordPress admin posts list

Add custom columns to the admin posts list The list of posts in the admin shows title, author, categories, tags, comments and date. Often the information editors check most is somewhere else: a price in a custom field, a reading time, the status of a review, a featured image. A column for it saves opening…