Links to previous/next month archives

Got it working! It’s not pretty but it’s functioning. $Y = get_the_time( ‘Y’ ); $M = get_the_time( ‘m’ ); $earlier_post = get_posts( [ ‘date_query’ => [ ‘before’ => [ ‘year’ => $Y, ‘month’ => $M, ‘day’ => 1, ], ], ‘orderby’ => ‘date’, ‘order’ => ‘DESC’, ‘posts_per_page’ => 1, ‘ignore_sticky_posts’ => 1 ] ); $prev_label … Read more

Create a Dropdown Selector and Redirect for a Custom Taxonomy in WordPress?

Never mind! I managed to come up with a solution. function insert_location(){ ob_start(); ?> <select name=”location” id=”location” class=”postform”> <?php $tax_terms = get_terms(‘location’, array(‘hide_empty’ => ‘0’)); foreach ( $tax_terms as $tax_term ): echo ‘<option value=”-1″>Select a Location</option><option class=”level-0″ value=”‘.get_term_link($tax_term).'”>’.$tax_term->name.'</option>’; endforeach; ?> </select> <script type=”text/javascript”> /* <![CDATA[ */ (function() { var dropdown = document.getElementById( “location” ); function … Read more

Pagination in single.php

Custom loops do not produce pagination like that. You have two options: Use custom archive page and provide custom php template for that (i.e. archive-my_name.php), in this custom template you could provide all other necessary content. Then you could use standard built-in pagination functions https://developer.wordpress.org/themes/functionality/pagination/ Continue in the direction you started, with single.php, but you … Read more