Error in pdf generating plugin using FPDF

The problem is that your output_pdf() function is being called too early. You have the function running in the root of the main plugin file, meaning that it runs as soon as the plugin is loaded, and before before WordPress has finished loading. You need to at least hook it to run later, such as … Read more

How to group only VISIBLE posts? [closed]

Give the divider an attribute, ie: data-target=”.group_20211006″ and add class to the post container, ie: class=”blah group_20211006″. After the filter changes, loop through each divider and check if there’s any visible post container with matching date value. HTML <!– First Group –> <div class=”divider” data-target=”.group_20211001″>October 1, 2021</div> <div class=”post-1 group_20211001″>…</div> <div class=”post-2 group_20211001″>…</div> <div class=”post-3 … Read more

the_posts_pagination() not working in wpquery

Thanks to @Buttered_Toast i’ve managed to get it work by changing: <?php the_posts_pagination( array( ‘mid_size’ => 2, ‘prev_text’ => __( ‘Back’, ‘textdomain’ ), ‘next_text’ => __( ‘Onward’, ‘textdomain’ ), ) ); ?> to: <?php echo paginate_links( array( ‘base’ => str_replace( 999999999, ‘%#%’, esc_url( get_pagenum_link( 999999999 ) ) ), ‘total’ => $postslist->max_num_pages, ‘current’ => max( 1, … Read more

Get posts that do not have the same tags as current

I found an answer to my own question: If I use the tax_query arg then I could specify ‘operator’ => ‘NOT IN’ like so: $events = tribe_get_events([ ‘tax_query’ => array( array( ‘taxonomy’ => ‘post_tag’, ‘field’ => ‘name’, ‘terms’ => $current_tag, ‘operator’ => ‘NOT IN’ // HERE ) ), ‘start_date’ => ‘now’, ‘eventDisplay’ => ‘list’, ‘posts_per_page’ … Read more

Is this meta query problematic?

Short answer is: Big Meta Queries are incredibly bad and can quickly lead to the MySQL-Server not responding anymore. You should try to rework the meta_query to not have so many clauses. Long Answer: Wordpress Post Metadata is stored incredibly inefficient when it comes to querying. Best advise would be to never ever EVER store … Read more