get_the_ID() retrieves same ID on Gutenberg’s Query Loop

No, you did nothing wrong. It’s a known issue and in WordPress v6.1.3 and up to the current stable release as of writing (v6.2.2), it’s happening because of the following lines in get_the_block_template_html() which returns the markup for the current (block-based) template: $content = do_shortcode( $content ); $content = do_blocks( $content ); So as you … Read more

new WP_Query with order args – no more distinction between categories

On the template driving your archive page, you can use the query_posts() function to adjust the main query (WordPress’ default main query, not your custom one). query_posts( array( ‘orderby’ => ‘modified’, ‘order’ => ‘ASC’, ) ); Using the pre_get_posts action is the better method, though slightly more complex (untested, would go in theme’s functions.php or … Read more

How do I exclude the current post from the upcoming post query

I think you are asking how to exclude the current exhibition from your upcoming exhibitions query. If that is the case, simply insert the ID of the current exhibition into the query using ‘post__not_in’: $exhibition_upcoming_query = array( ‘post_type’ => ‘exhibition’, ‘orderby’ => ‘meta_value’, ‘order’ => ‘ASC’, ‘posts_per_page’ => 3, ‘post__not_in’ => array( $exhibition_current_loop->posts[0]->ID ), ‘meta_query’ … Read more

How to change url of posts?

You can customize your permalink structure to include “blogs” for posts. Here are the steps to do that: Go to your WordPress dashboard and click on “Settings” > “Permalinks”. Select the “Custom Structure” radio button. In the text field, enter “/blogs/%postname%/” (without the quotes). Click the “Save Changes” button. This will set the permalink structure … Read more