How can I create an entirely new, separate display of posts?

Here’s what I ended up with: Everything within my child-theme file example-single.php for displaying individual posts within a template file example.php a new template as a destination for new routes. new routes and a filter on ‘pre_get_posts’ All of the following can simply go in functions.php in the child theme: function example_routes() { // add … Read more

wp_mail function not working in user query loop

It’s possible that there’s an issue with your SMTP configuration or with the mailing queue. You can try using a debugging plugin, such as WP Mail Logging, to help diagnose the issue. This plugin logs all emails sent through WordPress and displays them in the admin dashboard, allowing you to see if the emails are … Read more

How i can display all posts order by years

You need to add an if statement current loop to print out a year container around your articles. <?php if( have_posts() ) : ?> <?php $current_year = date(‘Y’); // Get the current year and set it $first = true; // Set a $first variable; while ( have_posts() ) : the_post(); if ( $first || get_the_date(‘Y’) … Read more

Divide loop into several columns based on post custom field and enable infinite scrolling

Use something like this for each column. <!– custom field = ‘normal’ –> <div class=”span2 normal”> <?php // The Query $the_query = new WP_Query( array( ‘meta_key’ => ‘your_custom_field_name’, ‘meta_value’ => ‘normal’ ); // The Loop while ( $the_query->have_posts() ) : $the_query->the_post(); echo ‘<div class=”post”> <h1>’ . get_the_title() . ‘</h1> </div>’; endwhile; // Reset Post Data … Read more