count listings… and display on text widget

WordPress Business Themes Forums Version 7 Themes DirectoryPress count listings… and display on text widget

Discontinued - The forum content is out of date. For theme support please use our support desk here.

count listings… and display on text widget

February 25, 2014
Rainer Rainer
  • Rainer
    Rainer
    Newbie 13 points

    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

    February 25, 2014 at 9:01 pm
  • Malgorzata
    Malgorzata
    Super Guru 1,606 points

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

    February 26, 2014 at 12:46 am
  • Rainer
    Rainer
    Newbie 13 points

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

    February 26, 2014 at 7:17 am
  • Ian
    Ian
    Super Guru 1,200 points

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

    February 26, 2014 at 11:02 am
  • Rainer
    Rainer
    Newbie 13 points

    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….

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

    anyone?

    March 5, 2014 at 7:49 pm
  • Michael
    Michael
    Newbie 83 points

    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/

    March 5, 2014 at 11:22 pm
    This reply was awarded the best answer by the topic poster.
  • Ian
    Ian
    Super Guru 1,200 points

    There you go…it will be listing_type instead of coupon_type

    March 6, 2014 at 12:46 am
  • Leo
    Leo
    Senior Member 100 points

    @Ian, works pretty well, thanks.

    March 6, 2014 at 1:11 am
  • Rainer
    Rainer
    Newbie 13 points

    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 :(

    March 6, 2014 at 7:46 pm
  • Ian
    Ian
    Super Guru 1,200 points

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

    March 6, 2014 at 11:51 pm
  • Leo
    Leo
    Senior Member 100 points

    @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/

    March 7, 2014 at 3:04 am
  • Rainer
    Rainer
    Newbie 13 points

    @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.

    March 7, 2014 at 8:00 pm
  • Richard Bonk
    Richard Bonk
    Super Guru 2,739 points

    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

    March 8, 2014 at 2:58 am
  • Ian
    Ian
    Super Guru 1,200 points

    Kind regards,

    Richard

    Welcome back :)

    March 8, 2014 at 3:09 am
Viewing 15 posts - 1 through 15 (of 41 total)

Didn't find what you were after?

Chat with us now

or contact our support team