While creating Block Themes in WordPress, how can I query custom posts for an Archive view?

I found a solution for this. So for those of you who face a similar situation, here’s what I did (based on this solution : https://stackoverflow.com/questions/68871598/wordpress-query-loop-block-not-showing-custom-post-types) So basically the custom post type that I had created needed to have this argument while registering the post-type in functions.php ‘show_in_rest’ => true And then I just had … Read more

Showing post thumbnail (attachment) on the archive.php category listing

You could use the WordPress function get_children. Although I don’t think it makes a difference, performance-wise. <?php while (have_posts()) : the_post(); ?> <?php $attachment = array_values( get_children( array( ‘post_parent’ => $post->ID, ‘post_type’ => ‘attachment’, ‘post_mime_type’ => ‘image’, ‘order’ => ‘ASC’, ‘numberposts’ => 1 ) ) ); ?> <div class=”searchItem” style=”clear:both;”> <h3 id=”post-<?php the_ID(); ?>”> <?php … Read more

Multi-level page hierarchy

menu with non dynamic content if the menu structure is fixed then you can create a fixed menu using the “new” wp menu system (quadrillion weblog postings on that) menu with dynamic content if the menu structure is not fixed you can: a. ask the users to manually maintain the menu after e.g. adding a … Read more

How do I tell how popular a theme is?

Assuming that you are talking about commercial/premium themes the obvious answer is Google WordPress (theme name) and compare the results. A popular theme would likely have more results. WordPress.org lists the theme’s it contains according to how many times they have been downloaded.

Help with WordPress Query

After calling get_recent_posts() (or any other loop query), you typically have to run a foreach or while loop to cycle through the posts. So, you’ll need to change this: <?php $args = array( ‘tag’ => ‘featured’, ‘posts_per_page’ => ‘3’ ); $recent_posts = wp_get_recent_posts( $args ); ?> <!– Your HTML and WordPress template tags here. –> … Read more