‘post’, ‘post_status’ => ‘publish’, ‘posts_per_page’ => 5, ‘s’ => sanitize_text_field($tag) ]); foreach ($results as $post) { if (!in_array($post->ID, $unique_ids)) { $posts[] = $post; $unique_ids[] = $post->ID; } } } } // Priority 2: Focus Keyword if ( empty($posts) && !empty($generated['focus_keyword']) ) { $results = get_posts([ 'post_type' => 'post', 'post_status' => 'publish', 'posts_per_page' => 5, 's' => sanitize_text_field( $generated['focus_keyword'] ) ]); foreach ($results as $post) { if (!in_array($post->ID, $unique_ids)) { $posts[] = $post; $unique_ids[] = $post->ID; } } } // Priority 3: Latest Articles if (empty($posts)) { $posts = get_posts([ 'post_type' => 'post', 'post_status' => 'publish', 'posts_per_page' => 5, 'orderby' => 'date', 'order' => 'DESC' ]); } return array_slice($posts, 0, 5); } /** • Append Related Articles section • to generated article content. */ function stai_insert_internal_links( $article, $generated ) { $links = stai_get_internal_links( $generated ); if (empty($links)) { return $article; } $html = “”; $html .= ’ Related Articles ‘; $html .=’ ’; foreach ($links as $post) { if (empty($post->ID)) { continue; } $html .= sprintf( '
  • %s
  • ', esc_url( get_permalink($post->ID) ), esc_html( get_the_title($post->ID) ) ); } $html .= ’ ’; return $article . $html; } ?> Comments on: 49th AGM: RITES approves final dividend of ₹6/share https://www.sarkaritel.com/49th-agm-rites-approves-final-dividend-of-%e2%82%b96-share/ India Government News, PSU & Policy Updates Sat, 16 Sep 2023 00:28:09 +0000 hourly 1 https://wordpress.org/?v=7.0