Using class id from array for query

Try this after your $wpdb query: // collect calendar id’s $ids = array(); foreach( $calendar_entries as $calendar_entries): array_push( $ids, $calendar_entries->id ); endforeach; // query the above calendar id’s $args = array( ‘post_type’ => ‘post’, ‘post__in’ => $ids, ‘orderby’ => ‘id’, ‘order’ => ‘DESC’ ); $query = new WP_Query( $args ); You can also modify the … Read more

Get query result before posts are displayed?

You can use the the_posts filter to loop through the results before they get returned. Proof of concept: function test_the_posts($a) { var_dump($a); die; } add_action(‘the_posts’,’test_the_posts’); I am fairly certain (though I haven’t tested it) that you could pretty easily break pagination and probably other things by fiddling with that, so be careful.

Get first comment link on the post itself

you can get comment link by wp function $args = array( ‘number’ => ‘1’, ‘post_id’ => your_post_id, // use post_id, not post_ID ); $comments = get_comments($args); <a href=”https://wordpress.stackexchange.com/questions/108654/<?php echo get_comment_link( $comments->comment_ID ); ?>”>postname</a>

display certain category on custom template page

You should not use category parameter to query custom taxonomy instead you should use tax_query parameter or directly custom taxonomy name as shown in the following query. query_posts( array( ‘post_type’ => ‘ublalfieportfolio’, ‘ublalfieportfolio-categories’ => ‘parketten’, ‘posts_per_page’ => -1) ); Refer this page to know how to use custom taxonomy parameter in custom query.

Set posts per page for parent category and it’s all children

You want get_term_children. function hbg_category_query( $query ) { if( $query->is_main_query() && $query->is_category()) { $categories = get_term_children(1,’category’); $categories[] = 1; // add your special category if (is_category($categories)) { $query->set( ‘posts_per_page’, 32 ); } } return $query; } add_action(‘pre_get_posts’,’hbg_category_query’); Barely tested, but I think that will work.

Meta_query not filtering posts

I think you don’t have to use meta_query. Simply use the code like shown below: $args = array( ‘post_type’ => ‘property’, ‘meta_key’ => ‘rental_type’, ‘meta_value’ => ‘Vacation’ ‘posts_per_page’ => $properties_per_page, ‘paged’ => $paged ); Also you got to get the value of $properties_per_page before this query.

confirm my booking with phone number

I understand your problem but in your question your going from submission of a form to querying data you expect in the database then displaying it. That covers a lot of steps. My first question is have you confirmed that your submitted form values are being stored as you expect? We need to rule out … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)