Display posts on parent post if author coincides

I found it (easy one): In functions.php: // Allow author for custom post function allowShowAuthor() { add_post_type_support( ‘cust_post-type’, ‘author’ ); } add_action(‘init’,’allowShowAuthor’); In the content template: <ul class=”author-posts”> <?php $current_page_author = get_the_author(); $catquery = new WP_Query( ‘cat=7&posts_per_page=30&order=DESC&author_name=” . $current_page_author ); while($catquery->have_posts()) : $catquery->the_post(); ?> <li class=”author-post”><?php the_content();?></li> <?php endwhile;?>

How to add in WP_Query to every 3 posts displayed? [duplicate]

This would work: <?php $args = array( ‘post_type’ => ‘product’, ‘posts_per_page’ => 8, ‘orderby’ => ‘date’, ); $loop = new WP_Query( $args ); if ( $loop->have_posts() ) { $i=1; echo ‘<ul>’; while ( $loop->have_posts() ) : $loop->the_post(); //wc_get_template_part( ‘content’, ‘product’ ); ?> <li class=”col-md-3″> <div class=”gridproduto”> <a href=”https://wordpress.stackexchange.com/questions/266104/<?php the_permalink(); ?>”> <?php global $post, $product; ?> … Read more

Get posts by birthday

What you can do is create a meta field under a post and store birth date in that field. Now you need meta_query in you post to retrieve the current date posts. <?php $currentDate = current_time( ‘Y-m-d’ ); $args = array( ‘post_type’ => ‘my_custom_post_type’, ‘meta_key’ => ‘birth_date’, ‘order’ => ‘ASC’, ‘meta_query’ => array( array( ‘key’ … Read more

wp_schedule_event function reference

I think if you need to call page every hour you can do it with a simple cron (not wp_cron) and set it in your panel or via shell a string like this: */1 * * * wget -O – /path/to/link >/dev/null 2>&1 But if you need to do it via wp add_action(‘wp’, ‘set_cron’ ); … Read more