LIMITED OFFER: Save $200 Today! - Get All Themes For $199 -- Learn More

Ask the community

This is a community support forum where you can ask
questions and interact with other PremiumPress Customers.

count listings… and display on text widget

  • Rainer
    Rainer
    Newbie 13 points
    February 25, 2014 at 9:01 pm

    Hi there,
    I would like to publish the number of listings that are created on my website. So if some people add listings a new visitor could read that on my website are already xx listings… Is there any shortcode for this?

    cheers,
    Rainer

  • Malgorzata
    Malgorzata
    Super Guru 1,606 points
    February 26, 2014 at 12:46 am

    If you have categories displayed on home page or in widget it usually says how many listings in each category, automatically.

  • Rainer
    Rainer
    Newbie 13 points
    February 26, 2014 at 7:17 am

    Hi… you are right… but I would like to use the whole number of entries of all categories..

  • Ian
    Ian
    Super Guru 1,200 points
    February 26, 2014 at 11:02 am

    There isn’t an existing shortcode that I know of…Are you sure you need a shortcode? Where will you put this?

  • Rainer
    Rainer
    Newbie 13 points
    February 26, 2014 at 12:05 pm

    I had this before already on my website but since I am reinstalling my website right now cause of a system crash…. There is no existing shortcode but it was a short string that will give out the number of all listings… I just cant find it anymore.

    The purpose is that new visitors will always see how many complete listings are already submitted…I would like to put this within the fancy note (textbox)on the left side….

  • Rainer
    Rainer
    Newbie 13 points
    March 5, 2014 at 7:49 pm

    anyone?

  • Michael
    Michael
    Newbie 83 points
    March 5, 2014 at 11:22 pm

    There is a thread in the Coupon forum similar to this, and they solved it for the coupon theme. You might give it a try, looks like it could be adapted to your needs.

    http://www.premiumpress.com/forums/topic/how-to-display-total-number-of-coupons-added/

    This reply was awarded the best answer by the topic poster.
  • Ian
    Ian
    Super Guru 1,200 points
    March 6, 2014 at 12:46 am

    There you go…it will be listing_type instead of coupon_type

  • Leo
    Leo
    Senior Member 100 points
    March 6, 2014 at 1:11 am

    @Ian, works pretty well, thanks.

  • Rainer
    Rainer
    Newbie 13 points
    March 6, 2014 at 7:46 pm

    Thank you very much…but unfortunately it doesnt work on my end…. I used two different php widgets but it only showed me the echo text but not the counted number…

    <?php
    $count_posts = wp_count_posts('listing_type');
    $totallistings = $count_posts->publish;
    echo 'Total number of listings: '.$totallistings;
    ?>

    Anyways… before I received a short code like the first line but it wasnt php… It did show directly the number of all listings so I could write it in the fancy notice widget :(

  • Ian
    Ian
    Super Guru 1,200 points
    March 6, 2014 at 11:51 pm

    As far as I recall the fancy notice widget just shows the text you type in…

  • Leo
    Leo
    Senior Member 100 points
    March 7, 2014 at 3:04 am

    @Rainer, this code works for me
    <?php
    $totalcoupons = wp_count_posts('listing_type')->publish;
    ?>
    Now serving <? echo $totalcoupons; ?> ad listings

    I use PHP Code Widget plugin
    http://ottopress.com/wordpress-plugins/php-code-widget/

  • Rainer
    Rainer
    Newbie 13 points
    March 7, 2014 at 8:00 pm

    @Ian
    Yes that fancy text box dont work with php… but I got a code in [] or variables (only 3 or 4 words) and it give out the number of total listings w/in the fancy text… Too bad I cant remember that code but I got it also here in the forum…. Its already longer than 1 year ago, so its not anymore listed here :(

    @Leo
    Thanx again… I used already exactly that plugin and tried it with your code… but its still just showing the text “Now serving ad listings” w/out any number.

  • Richard Bonk
    Richard Bonk
    Super Guru 2,739 points
    March 8, 2014 at 2:58 am

    I have created a plugin that will add a shortcode that can be used in most places on the site which will display the following:

    count listings added today
    count listings added this week
    count listings added this month
    count listings in total
    count total categories
    count total stores (when this taxonomy is present)

    http://premiumwebservices.co.uk/shop/responsive-themes-plugins/show-count-shortcode/

    Hope this will be of use.

    Kind regards,

    Richard
    ____________________________________________________________________
    Wide range of WordPress Plugins
    Premium and Free PremiumPress plugins and add-ons
    Newly released collection of Responsive Themes plugins
    PremiumPress customisation services and Website Design
    Selection of PremiumPress Child Themes

  • Ian
    Ian
    Super Guru 1,200 points
    March 8, 2014 at 3:09 am

    Kind regards,

    Richard

    Welcome back :)

Viewing 15 posts - 1 through 15 (of 41 total)