If Post Published Date or Modified Date is 1 Year or Older, Display Notice on Post Page

Right now you’re just checking for the post date. You’ll need to check for ‘post_modified’ aswell. You can find the complete post-object here: https://developer.wordpress.org/reference/functions/get_post/#user-contributed-notes You can modify the check to look something like this: if (strtotime($post->post_date) < strtotime(‘-1 year’) && strtorime($post->post_modified) < strtotime(‘-1 year’)){ echo ‘Old Post’; } else { echo ‘Not Old Post’; } … Read more

WordPress Query – Display 5 posts (same post type), each from a given tag

Managed to get what I wanted like so: // first query $first_ids = get_posts( array( ‘post_type’ => POST_TYPE_KIB_HIREK, ‘posts_per_page’ => 1, ‘post_status’ => ‘publish’, ‘orderby’ => ‘date’, // popular – ha a legolvasott ‘tag_id’ => 102, ‘order’ => ‘DESC’, ‘fields’ => ‘ids’, ‘post_status’ => ‘publish’, ‘orderby’ => ‘date’, ‘order’ => ‘DESC’ )); // second query … Read more