Results 1 to 5 of 5

Thread: How to display number of posts found when perform search

  1. #1
    Thread Starter
    joes's Avatar
    Join Date
    Nov 2012
    Location
    Australia
    Posts
    877
    Thanks
    12
    Thanked 358 Times in 261 Posts

    How to display number of posts found when perform search

    If you don't like the bland message that displays the following:

    Listings found for "dog" near ""


    You may want it to display the total number of posts found to indicate to the user the number found when the page displays say 10 listings on the page.

    Something like:

    23 Listings found for "dog" near ""


    You can achieve this with the following code change:

    In the "\vantage\archive-listing.php" change the following line:

    Code:
    <h3 class="archive-head listing-archive-head"><?php printf( __( 'Listings found for "%s" near "%s"', APP_TD ), va_get_search_query_var( 'ls' ), va_get_search_query_var( 'location' ) ); ?></h3>
    to the following:

    Code:
    <h3 class="archive-head listing-archive-head"><?php  echo($wp_query->found_posts).' '; printf( __( 'Listings found for  "%s" near "%s"', APP_TD ), va_get_search_query_var( 'ls' ),  va_get_search_query_var( 'location' ) ); ?></h3>

    NOTE: You should be able to achieve the same for the Events by changing similar code in archive-events.php

  2. The Following 2 Users Say Thank You to joes For This Useful Post:

    bvpraveen (December 7th, 2013), philco (November 10th, 2013)

  3. #2
    philco's Avatar
    Join Date
    Oct 2013
    Location
    Australia
    Posts
    5
    Thanks
    2
    Thanked 0 Times in 0 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

  4. #3
    Expired Customer bvpraveen's Avatar
    Join Date
    Oct 2013
    Location
    Bangalore, India
    Posts
    119
    Thanks
    26
    Thanked 7 Times in 7 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

  5. #4
    red20me's Avatar
    Join Date
    Jul 2013
    Location
    United Kingdom
    Posts
    473
    Thanks
    1
    Thanked 104 Times in 93 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

  6. The Following User Says Thank You to red20me For This Useful Post:

    bvpraveen (December 9th, 2013)

  7. #5
    Expired Customer bvpraveen's Avatar
    Join Date
    Oct 2013
    Location
    Bangalore, India
    Posts
    119
    Thanks
    26
    Thanked 7 Times in 7 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. When search perform no result show
    By akashkash in forum ClassiPress General Discussion
    Replies: 0
    Last Post: August 4th, 2013, 03:30 AM
  2. [SOLVED] Change the number of posts on category, search results, and popular ads
    By dragosdaniel in forum Help Using ClassiPress
    Replies: 3
    Last Post: March 12th, 2013, 12:58 PM
  3. Change the number of posts on category, search results, and popular ads
    By dragosdaniel in forum ClassiPress General Discussion
    Replies: 1
    Last Post: March 11th, 2013, 01:34 PM
  4. How to perform multiselect search
    By maorlast in forum JobRoller General Discussion
    Replies: 3
    Last Post: June 4th, 2011, 09:21 AM
  5. How to perform multiselect search
    By maorlast in forum Report JobRoller Bugs
    Replies: 1
    Last Post: June 4th, 2011, 09:09 AM