I want to get title name of post, but i didn’t get by this code. Any suggestion?

Use this code: $args = array( ‘post_type’ => ‘food’, ‘orderby’ => ‘meta_value_num’, ‘meta_key’ => ‘listing_price’, ‘order’ => ‘DESC’, ‘posts_per_page’ => $count, ‘paged’ => $paged, ); $loop = new WP_Query( $args ); if ( $loop->have_posts() ): while ( $loop->have_posts() ) : $loop->the_post(); echo get_the_title(); echo get_the_content(); endwhile; endif;

How to change wordpress dates to native language (even if the languge not available i wordpress)

to use a translation not finished yet, click on “Export” here : https://translate.wordpress.org/projects/wp/dev/si/default . And save the files as si.po and si.mo in the directory wp-content/languages (choose the extension in the dropbox menu) If there is word missing, you can use Podedit to edit the file and you can also propose your word in the … Read more

Preserve term order per post in a non-hierarchical taxonomy

I encountered a similar issue and this is how I solved it. Note that I put in Fruits as the taxonomy name based on your example. It’s important that this name matches the taxonomy name exactly. Often taxonomy names are singular, i.e. fruit function wp4382_filter_terms_order( $orderby, $query_vars, $taxonomies ) { if ( ! empty( $query_vars[‘object_ids’] … Read more

How to Orderby Comments by post title?

The WP_Comment_Query class supports ordering by: ‘comment_agent’, ‘comment_approved’, ‘comment_author’, ‘comment_author_email’, ‘comment_author_IP’, ‘comment_author_url’, ‘comment_content’, ‘comment_date’, ‘comment_date_gmt’, ‘comment_ID’, ‘comment_karma’, ‘comment_parent’, ‘comment_post_ID’, ‘comment_type’, ‘user_id’, ‘comment__in’, ‘meta_value’, ‘meta_value_num’, There’s a way to adjust it via filters so we can support ordering by the post title: $args = [ ‘status’ => ‘approve’, ‘post_status’ => ‘publish’, ‘post_type’ => ‘post’, ‘orderby’ => … Read more

SQL query to retrieve all the records that have not indicated category

If I understand the question, you’re looking for the SQL for the equivalent of $args = array ( ‘post_type’ => ‘popular_music’, ‘post_status’ => ‘publish’, ‘tax_query’ => array ( array ( ‘taxonomy’ => ‘category’, ‘operator’ => ‘NOT EXISTS’, ), ), ‘posts_per_page’ => -1, ‘orderby’ => ‘ID’, ‘order’ => ‘DESC’, ) ; $query = new WP_Query ($args) … Read more

Comma separated all attached image ID numbers except featured image ID number

If we want to exclude the featured post image then here’s the one-liner updated: $ids = join( ‘,’, wp_filter_object_list( get_attached_media(‘image’ ), [ ‘ID’ => get_post_thumbnail_id() ], ‘NOT’, ‘ID’ ) ); here it’s expanded: $ids = join( ‘,’, // join array by comma wp_filter_object_list( get_attached_media(‘image’ ), // fetch attached images [ ‘ID’ => get_post_thumbnail_id() ], // … Read more