ID); if (empty($categories)) { return ''; // No categories, no related posts. } // Query arguments $args = array( 'category__in' => $categories, 'post__not_in' => array($post->ID), 'posts_per_page' => 1, 'offset' => $number - 1 // Skip the first ($number - 1) posts. ); $related_posts = new WP_Query($args); if ($related_posts->have_posts()) { $related_posts->the_post(); $options = get_option('iap_settings'); // Fetch settings or use defaults $background_color = !empty($options['background_color']) ? esc_attr($options['background_color']) : '#fffdf9'; $border_style = !empty($options['border_style']) ? esc_attr($options['border_style']) : 'dotted'; $border_color = !empty($options['border_color']) ? esc_attr($options['border_color']) : '#9b1717'; $also_read_text_color = !empty($options['also_read_text_color']) ? esc_attr($options['also_read_text_color']) : '#cb0000'; $also_read_text_font_style = !empty($options['also_read_text_font_style']) ? esc_attr($options['also_read_text_font_style']) : 'Arial'; $title_font_style = !empty($options['title_font_style']) ? esc_attr($options['title_font_style']) : 'Arial'; $title_font_color = !empty($options['title_font_color']) ? esc_attr($options['title_font_color']) : '#333'; $copyright_text = !empty($options['copyright_text']) ? $options['copyright_text'] : 'Developed by Mukesh Gusaiana'; // Output the related post HTML $output = '
1. Download the plugin zip file.
2. Go to your WordPress admin dashboard.
3. Navigate to Plugins > Add New.
4. Click the 'Upload Plugin' button at the top.
5. Select the downloaded zip file and click 'Install Now'.
6. Once installed, click 'Activate Plugin'.
7. Navigate to Settings > In-Article Posts to configure.
Mukesh Gusaiana
For more info,: Call or Whatsapp 8684838921