number of posts with “Load More”

You can get the (current) displaying posts number from offset number. As it’s an ajax load more for wp post, it should has the offset numbers. So, you can display the number like this Javascript var offset = 4; return $.ajax({ url: ajaxurl, type: “POST”, data: data, success: function(returnData) { // diplay offset number in … Read more

Displaying child taxonomy before parent

My assumption here is that within your data structure you have only two level hierarchy: Countries are always top level parent terms (they never have their own parents), Streets are first level children, and each street only has one parent and no children. Do you need a list of all terms? In that case you … Read more

Customizing the output of the archive and category widget without altering the original behavior of the widget

No, there are no filters for doing this. You would need to create your own version of the widgets in order to achieve this. You can find the default WordPress widgets in the following folder: /wp-includes/widgets in your WordPress installation. Simply copy the code from within the respective widget .php files in to your theme … Read more

Let user select the number of posts shown per page jquery error

A simple fix would be to change the query name; i.e. from page to pageVal. <script> jQuery(document).ready(function( $ ) { $(‘.page-select’).change(function(){ var checkIndex = ( window.location.href || ” ).indexOf(‘?’); if( checkIndex > -1 ){ var Link = window.location.href.substr(0, checkIndex-1); $(location).attr(‘href’, Link+’?pageVal=”+$(“.page-select’).val()); } else { $(location).attr(‘href’, window.location.href+’?pageVal=”+$(“.page-select’).val()); } }); }); </script> But I’d use this..: <script> … Read more

wordpress all post filter by year

<select name=”archive-dropdown” onchange=”document.location.href=this.options[this.selectedIndex].value;”> <option value=””><?php echo esc_attr( __( ‘Select Year’ ) ); ?></option> <?php wp_get_archives( array( ‘type’ => ‘yearly’, ‘format’ => ‘option’, ‘show_post_count’ => 1 ) ); ?> </select> This code may help you.

how to print total post count with 2 custom fields (date-range)

If you save the return of query_post(…) as a variable, and then run $var->found_posts, does that give you the expected result? Like so: $paged = ( get_query_var(‘paged’) ) ? get_query_var(‘paged’) : 1; $today = date(‘Y-m-d’, strtotime(‘-1 hours’)); $query = query_posts(array( ‘post_type’ => ‘post’, ‘paged’ => $paged, ‘orderby’ => ‘meta_value’, ‘order’ => ‘ASC’, ‘meta_query’=>array( ‘relation’=>’AND’, array( … Read more