get_template_part for each level of taxonomy term

Creating and including a template for your custom post type archive is easy, you just need to create a archive-{$post_type}.php template, WordPress will automatically use that template whenever you visit that particular post type’s archive page. Just remember to set the has_archive parameter when registering your post type. As for the taxonomy archive page, you … Read more

Multiple Loops Inside a Function

the permalink and post title won’t be available until after you’ve run the query. the following should return the last 3 posts from the designated category. the same post is being displayed 3 times because it doesn’t look like you’re setting the permalink or post title from within “the loop” if (!function_exists(‘get_posts_menus’)): function get_posts_menus($category_name, $count) … Read more

Show a different post every 3 days [duplicate]

Your code example isn’t random though, it’s a fixed offset, based on a week number. As stated this isn’t something that can be expressed in query API I think. You would probably have to keep track of state with something like following algorithm: Query a random post, store its ID Store a date three days … Read more

Creating a multi-taxonomy query, excluding the newest (read: highest ID) taxonomy term

Have you considered using a more standard loop, like this? I think it might fix your issue #3. $query = new WP_Query( $args ); echo ‘<div class=”home-middle widget-area”>’; echo ‘<h4 class=”widget-title widgettitle”><span>From the Archives</span></h4>’; if ($query->have_posts()) { while ($query->have_posts()) { $query->the_post(); echo ‘<article class=”post type-post status-publish format-standard has-post-thumbnail entry”>’; echo ‘<a href=”‘ . get_the_permalink() . … Read more

Loop through all product posts?

Take a look at WordPress codex for WP_Query for more information. You’ll see there are different parameters for WP_Query, you just need to add the posts_per_page parameter with the value set to -1 to show all posts. $products_IDs = new WP_Query( array( ‘post_type’ => ‘product’, ‘posts_per_page’ => -1, )); while ($products_IDs->have_posts() ) : $products_IDs->the_post(); // … Read more