Show google ads when heading4 available otherwise showing ads on bottom of content- function thekroyaard_ads_heading_4( $content ) { $ad_code = ‘ <div class=”thekroyaard_ads_heading_3″> <script async src=”https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-xxxxxxxxxxxxxxxxxx” crossorigin=”anonymous”></script> <ins class=”adsbygoogle” style=”display:block” data-ad-client=”ca-pub-xxxxxxxxxxxxxxxx” data-ad-slot=”xxxxxxxx” data-ad-format=”auto” data-full-width-responsive=”true”></ins> <script> (adsbygoogle = window.adsbygoogle || []).push({}); </script> </div>’; if ( is_single() ) { return ads_insert_after_paragraph( $ad_code, 1, $content ); } return […]

wpdetector

Use WPdetector online tool and know theme’s or plugins information of any website. Simply open WPdetector website on your device. How To Do Go to WPdetector or click here. Then enter full url of any website. Click to Detect button after entered web address. This website absolutely free. Check any website’s theme/plugins information. Thanks for […]

Paste this code for where you want to show latest post. <?php $the_query = new WP_Query( ‘posts_per_page=5’ ); while ($the_query -> have_posts()) : $the_query -> the_post(); ?> <div><a href=”<?php the_permalink() ?>”><?php the_title(); ?></a></div> <?php endwhile; wp_reset_postdata(); ?>

php-Code-for-Comment-Validator

Add this code on functions.php. And make human validation function when someone do comment on your post. function validator_for_comments() { $a = rand(1, 100); $b = rand(1, 100); $c = $a + $b; echo ‘<p class=”comment-form-math”>’; echo ‘<label for=”comment_math”>’ . __(‘What is ‘ . $a . ‘ + ‘ . $b . ‘?’) . ‘</label>’; […]

Use this code on functions.php, then paste [show_last_week_populer] shortcode for showing last week’s popular Items. function popular_posts_last_week() { global $wpdb; $most_visited_posts = $wpdb->get_results(“SELECT p.ID, p.post_title, pm.meta_value AS ‘views’ FROM {$wpdb->prefix}posts AS p JOIN {$wpdb->prefix}postmeta AS pm ON p.ID = pm.post_id WHERE p.post_status = ‘publish’ AND p.post_type = ‘post’ AND pm.meta_key = ‘post_views_count’ AND DATE_SUB(CURDATE(), INTERVAL […]

Use this code for set automatically thumbnail without plugins – //Automatic Thumbnail when embed YT videos lite or standard version function set_automatically_featured_image_from_embed_YT_videos_thekroyaard($post_ID) { if (!has_post_thumbnail()) { $post_content = get_post_field(‘post_content’, $post_ID); $alt_name_make = get_post( $post_ID )->post_title; $auto_alt_id = get_the_ID(); $alt_name_YT = wp_trim_words( $alt_name_make, 5, $more = __( ‘ ‘.’ Thumbnail ‘. $auto_alt_id ) ); $alt_name_YT = […]