Top tags with minimum number of posts

I found a solution!: $term_ids = $wpdb->get_col(” SELECT term_id FROM $wpdb->term_taxonomy INNER JOIN $wpdb->term_relationships ON $wpdb->term_taxonomy.term_taxonomy_id=$wpdb->term_relationships.term_taxonomy_id INNER JOIN $wpdb->posts ON $wpdb->posts.ID = $wpdb->term_relationships.object_id WHERE DATE_SUB(CURDATE(), INTERVAL 1 DAY) <= $wpdb->posts.post_date” ); $tags = get_tags(array( ‘orderby’ => ‘count’, ‘order’ => ‘DESC’, ‘number’ => ’10’, // <– maximum number of tags ‘include’ => $term_ids, ‘fields’ => ‘ids’ … Read more

How to create page with post content in it?

You might get away with shortcodes: add_shortcode(‘title’, function ($atts, $content = null) { $atts = shortcode_atts([ ‘id’ => null, ], $atts); $title=””; if (!empty($atts[‘id’])) { $title = get_the_title($atts[‘id’]); } return $title; }); add_shortcode(‘content’, function ($atts, $content = null) { $atts = shortcode_atts([ ‘id’ => null, ], $atts); $content=””; if (!empty($atts[‘id’])) { $post = get_post($atts[‘id’]); // … Read more

Strange behaviour in WordPress admin

I’d first make sure that everything is updated: WP, themes, plugins. Then I’d look at the plugin’s WP page and see how long it’s been since they have been updated. You might have some old plugins that could be causing problems, like maybe they are using old JS. I’d also look at the page source … Read more

Remove pagination if search returns empty

add this code in your search.php <?php $show_pagination = true; if($wp_query->post_count < 0) { $show_pagination = false; } ?> <?php if($show_pagination){ ?> <!– The pagination component –> <div class=”container”> <div class=”row mt-3″> <?php understrap_pagination(); ?> </div> </div> <?php } ?> So your search.php look like this : <div class=”wrapper” id=”search-wrapper”> <div class=”<?php echo esc_attr( $container … Read more