• Resolved miclovin

    (@miclovin)


    Is there a way to show only the property count? For example, I want to make a heading for a page that says something like “We have over XXX Properties” where XXX is the total properties in wp-property.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Contributor MariaKravchenko

    (@mariakravchenko)

    Hello.

    You could use that code to find out

    $args = array(
          'post_type' => 'property',
          'post_status' => 'published',
          'posts_per_page' => 99999
        );
        $query = new WP_Query($args);
        echo '<pre>';
        print_r($query);
        echo '</pre>';

    Regards.

    Plugin Contributor MariaKravchenko

    (@mariakravchenko)

    Or this one

    $args = array(
          'post_type' => 'property',
          'post_status' => 'published',
          'posts_per_page' => 99999
        );
        $query = new WP_Query($args);
        $found_posts = $query->found_posts;
    echo $found_posts; // this one will show the number
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Property Count’ is closed to new replies.