How to show the amount of post that have on the site?

Using a query could give you easier customization without having to use SQL directly. $posts = get_posts( array( ‘post_type’ => ‘post’, ‘post_status’ => ‘any’, ‘numberposts’ => -1, ‘fields’ => ‘ids’, )); $total_count = count( $posts ); print_r ( $total_count );

Having problems getting the number of plays in a WordPress Playlist from an audio file

The code requires at least PHP 5.3. Dreamweaver does not support that PHP version, so it reports unknown, newer syntax as errors. WordPress requires just version 5.2.4, but it recommends at least 5.4. My suggestion is to use always the latest stable version on the server, currently PHP 5.6. Your development setup should use exactly … Read more

How to export tag counts to excel?

Please note that this stack is more focused on development, asking for ready–made solutions like plugins isn’t considered in scope. From perspective of native functionality and power user perspective you can sort tags by count in WP admin interface. You can also tweak how many tags are displayed via Screen Options (top right of page). … Read more

How make animation increase of number

i make this: $(window).scroll(function() { var currentNumber = $(‘.js-number-lifetime’).text(), targetNumber = $(‘.js-number-lifetime’).attr(‘data-target’); $({numberValue: currentNumber}).animate({numberValue: targetNumber}, { duration: 1000, easing: ‘linear’, step: function() { $(‘.js-number-lifetime’).text(Math.ceil(this.numberValue)); } }); var currentNumber1 = $(‘.js-number-clients’).text(), targetNumber1 = $(‘.js-number-clients’).attr(‘data-target’); $({numberValue: currentNumber1}).animate({numberValue: targetNumber1}, { duration: 1000, easing: ‘linear’, step: function() { $(‘.js-number-clients’).text(Math.ceil(this.numberValue)); } }); var currentNumber2 = $(‘.js-number-employee’).text(), targetNumber2 = $(‘.js-number-employee’).attr(‘data-target’); $({numberValue: … Read more

Adding Count Post in Page

If you are asking about woocommerce, this function is located in woocommerce/templates/loop/results-count.php Here’s the full code, you will get the logic if you go through it. $paged = max( 1, $wp_query->get( ‘paged’ ) ); $per_page = $wp_query->get( ‘posts_per_page’ ); $total = $wp_query->found_posts; $first = ( $per_page * $paged ) – $per_page + 1; $last = … Read more

How to calculate posts number? [closed]

Do you mean like this $result = 10; foreach ( $posts as $post ) { if ( $a = $b ) ) { $result += 1; } else { $result -= 2; } } echo ‘Your result is ‘ . $result; This is the best I can do with the provided information

post_count not working

post_count is not a parameter of WP_Query argument. post_count is a property used to get the number of posts being displayed. For example, echo $my_related_posts->post_count; will display the number of posts being displayed.