• Resolved nav4339

    (@nav4339)


    How can I make the listing count display on the single listing page? Currently it only displays for Related Listings. I do not see the option to add the View Count button under Directory Builder for single listings. Is there a shortcode that I can use for Custom Content. I am using Version 8.6.9 of the plugin along with Sydney theme and Elementor

Viewing 1 replies (of 1 total)
  • Plugin Support Al-Amin Khan

    (@alamin56649)

    Hi @nav4339,

    Thank you for reaching out.

    At this moment, the view count feature is only available on listing card (for example, all listings and related listings). It is not included by default on the single listing page, and there isn’t a built-in option to include it from the Directory Builder.

    However, you can display the view count on the single listing page with a small customization. You may add the following snippet to the single listing template where you’d like the count to appear:

    <span class="directorist-view-count" data-id="<?php the_ID(); ?>">
    <?php directorist_icon( $icon ); ?>
    <?php echo esc_html( $listings->loop['post_view'] ?? 0 ); ?>
    </span>

    You can find the relevant template file here:
    wp-content/plugins/directorist/templates/single-contents.php

    That said, we strongly recommend not editing plugin core files directly, as changes will be lost after updates. Instead, please override the template by copying it to your theme directory like this:

    yourtheme/directorist/single-contents.php

    Then add the code there safely. To lrean more about template overwritting you can follow this article available here: https://directorist.com/docs/template-override/

    Feel free to reach out if you need guidance with the template override process.

    Best regards,
    Al-Amin Khan

Viewing 1 replies (of 1 total)

You must be logged in to reply to this topic.