how to set default value for checkbox in wordpress

I think the problem might could be the logic with using checked… <input type=”checkbox” name=”aps_display_post_title” value=”yes” <?php if ($aps_display_post_title != ‘no’) {echo ‘checked’;} ?> /> …on the other hand then running sanitize_text_field on the checkbox value might also be causing the problem. Instead you might want to break the logic down differently so it is … Read more

WP_Query tax_query on ACF post_object

Update 1 As @Florian pointed out, we do not need to use the wp_list_pluck function, we could simply add the ‘fields’ => ‘ids’ to the WP_Query to retrieve the list of ids: $producers = new WP_Query( array( ‘fields’ => ‘ids’, ‘post_type’ => ‘producers’, ‘posts_per_page’ => -1, ‘tax_query’ => array( array( ‘taxonomy’ => ‘region’, ‘field’ => … Read more

Slug for standard post post_type

WordPress offers you the ability to create a custom URL structure for your permalinks and archives. For this you will have to change permalink, Permalinks allows you to choose your default permalink structure. To change permalink go to Settings > Permalinks in WP Backend. Choose Post name In Common Settings Section.

get_terms won’t display product_cat or any other custom taxonomies when specified

You are maybe running an old version of WordPress (before 4.5). Before WordPress 4.5.0, the first parameter of get_terms() was a taxonomy or list of taxonomies and since 4.5.0, taxonomies should be passed via the ‘taxonomy’ argument in the $args array (that what you are doing, it should work like that). You will find all … Read more