Show one post per author and limit query to 8 posts

I want to show 8 recent products from multiple authors on the frontpage. Need to show 1 recent product per author. Currently i’m using basic wp query to show recent 8 products. $args = array ( ‘post_type’ => array( ‘product’ ), ‘posts_per_page’ => ‘8’, ‘order’ => ‘DESC’, ‘orderby’ => ‘date’, ); // The Query $query … Read more

How can I show recent posts from same taxonomy as the post currently being viewed?

I’m wondering how I can show recent posts from the same taxonomy as the post that’s currently being viewed (working with custom post types and custom taxonomies). If it was simply a category of a regular post, it would look like this: <?php global $post; $categories = get_the_category(); foreach ($categories as $category) : ?> <h3>More … Read more

What’s the difference between “get_posts” and “wp_get_recent_posts” when used with “setup_postdata”?

This might be a completely “I’m still new to WP” type question, but I ran into some interesting output when using get_posts() and wp_get_recent_posts() in a custom function I wrote with setup_postdata(). Here’s what I had in my functions.php file: <?php function getRecentPosts($total_posts = 2) { $total_posts = intval($total_posts); global $post; $args = array( ‘posts_per_page’ … Read more

Display the date before the post title in recent posts widget

In the recent posts widget I have the post link first, and the post date second item, How can I change, to display the date in front of the post title? Thank you. register_sidebar( array( ‘name’ => __( ‘Események’, ‘ashe’ ), ‘id’ => ‘esemenyek’, ‘description’ => __( ‘Add widgets here to appear in your sidebar.’, … Read more

Add inline HTML to posts published within last 24hrs

Basically I’m looking to add this line of code to posts published within the last 24hrs: <span class=”new”>New!</span> When the post is over 24hrs old, remove the inline HTML element. This is my code so far but have no idea how to implement this feature, anybody got any ideas? <section class=”post-wrap”> <ul class=”filter”> <li><a href=”https://wordpress.stackexchange.com/questions/64170/<?php … Read more