How to add the option to choose between sizes for featured image within post editor?

<?php // First, enable thumbnails if they are not enabled yet add_theme_support( ‘post-thumbnails’ ); /* * Add image dimensions * * name * width * height * crop or resize (true or false) * * 99999 means very big number */ add_image_size( ‘featured-portrait’ , 200 , 99999, false ); add_image_size( ‘featured-landscape’ , 99999, 200 , … Read more

Woocomerce – Order products by float attribute in archive pages

OK… First of all, `$query->set( ‘orderby’, ‘pa_od’ );’ will most probably do nothing. You can’t order by some string and think that WordPress will guess what that is. Here is the list of possible orderby values: https://codex.wordpress.org/Class_Reference/WP_Query#Order_.26_Orderby_Parameters If you want to order by custom field, then you have to do it this way: $query->set( ‘meta_key’, … Read more

Embedded Options in a Custom Metabox

After a long investigation, it turned out that there isn’t any WordPress method that generates that information via methods/functions. That functionality should be built manually. For example, for the “publish post” metabox which contains the required functionality above, the code is listed here https://core.trac.wordpress.org/browser/tags/4.9/src/wp-admin/includes/meta-boxes.php#L22

Create dynamic / data driven pages in wordpress

There are potentially many ways to achieve what you want to do. My approach would be to use WooCommerce and then define ‘Ford Focus’ as a product. I then would configure the product to offer the various different colors and/or any other features. This approach would not create 5 pages on the sitemap. It would … Read more