Showing Co-Authors on post page

Your error is that you’ve written an if inside the sprintf argument list. You can’t do that. Instead, you could use the ternary operator, which has syntax <condition> ? <result if true> : <result if false> e.g. $byline = sprintf( __(‘by %s’), function_exists(‘coauthors_posts_links’) ? (‘<span class=”author vcard”>’ . coauthors_posts_links( null, null, null, null, false ) … Read more

I am trying to match the wpallimport using the Xpath Filter

Finally I found the solution to this issue on documentation of wp all import https://www.wpallimport.com/documentation/troubleshooting/encoding/ If you’re sure that your XML file is valid, it’s not using UTF-8 encoding, and WP All Import is still rejecting it, try adding this code snippet inside your child theme’s functions.php file add_filter( ‘is_xml_preprocess_enabled’, ‘wpai_is_xml_preprocess_enabled’, 10, 1 ); function … Read more

Capitalize All Titles and Headlines in Chicago Style

I took a look a Tom’s plugin that you referenced and made a stripped down version that simply runs post titles through the Title_case class on-the-fly. I tested it out, and it works. Unlike the original plugin, the code below just changes titles before they are displayed and not when saving posts. Plugin structure: /wpse-title-case/ … Read more

Sort products without thumbnail in WooCommerce shop page

I would try to rename the custom function and add meta_query too! So it’d be like this: function my_shop_custom_products_query( $q ) { $q->set( ‘meta_key’, ‘_thumbnail_id’ ); $q->set(‘orderby’, ‘meta_value_num’); $q->set(‘order’, ‘DESC’); $q->set( ‘meta_query’, array( array( ‘key’ => ‘_thumbnail_id’, ‘compare’ => ‘>=’, ‘value’ => ‘0’ ))); } add_action( ‘woocommerce_product_query’, ‘my_shop_custom_products_query’ ); If for some reason it didn’t … Read more