Ask the community

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

Directory Theme V9 Change Featured Listing ribbon text


  • George
    Newbie 26 points
    March 14, 2019 at 6:11 am

    I cannot find anywhere in the code where I can change the text “Featured” on the ribbon.
    Can someone point me to the right file?
    https://pdxpetsitstage.staging.wpengine.com

  • JamesD
    JamesD
    Super Guru 1,345 points
    March 14, 2019 at 8:47 pm

    Hello George,

    The shortcode request is in /DT9/content-listing.php core file.

    If you’re child theme doesn’t have the file, then copy it into your child theme directory.
    Open the file and look for <?php echo do_shortcode('[RIBBON]'); ?> around line #28 and add the text attribute with the custom text.

    For example: [RIBBON text=”Custom Text”]:
    <?php echo do_shortcode('[RIBBON text="Custom Text"]'); ?>

    Save the file and that should be it.


  • George
    Newbie 26 points
    March 14, 2019 at 8:54 pm

    Brilliant! Thank you so much, I should have asked sooner instead of banging my head against the wall!

  • JamesD
    JamesD
    Super Guru 1,345 points
    March 14, 2019 at 8:58 pm

    @George
    Ok, my bad. Use the one located: /DT9/_directory/template/content-listing.php. (copy to child, not directly edit)


  • George
    Newbie 26 points
    March 14, 2019 at 9:08 pm

    Thank you so much! Perfect!

  • JamesD
    JamesD
    Super Guru 1,345 points
    March 14, 2019 at 10:30 pm

    You’re welcome George.

  • Marie
    Marie
    Super Guru 1,747 points
    March 15, 2019 at 5:41 am

    Thanks for sharing James :)


  • Benny
    Newbie 2 points
    April 6, 2019 at 1:12 am

    Hi James,

    I use DT 9 and no child theme install. You said that need to change with child theme but I did not use it.
    Is it possible to use CSS code to change label on feature ribbon?
    If I can not change /DT9/_directory/template/content-listing.php directly – Could you let me know what is CSS code on how to change the text on ribbon?

  • JamesD
    JamesD
    Super Guru 1,345 points
    April 6, 2019 at 1:38 am

    Hello Benny,

    Is it possible to use CSS code to change label on feature ribbon?

    Not that I’m aware of. At least not an easy way if one isn’t really familiar with CSS and PHP.

    If I can not change /DT9/_directory/template/content-listing.php directly

    You can edit them if you really wanted, it’s just not recommended since it’s a part of the core theme directory and will be overwritten on each theme update. You will just need to re-customize the files after each update.

  • JamesD
    JamesD
    Super Guru 1,345 points
    April 6, 2019 at 2:47 am

    @Benny

    See if this helps using jQuery.
    Add this to your custom javascript file and change the text:

    jQuery(document).ready( function() {
        jQuery('.listing-grid-item .featured'). text("My Custom Text");
    } );

    If you don’t have a file for custom JS then you can add this to the bottom of your _functions.php file:

    function update_ribbon_text() { ?>
    <script type="text/javascript">
    	jQuery(document).ready( function() { jQuery('.listing-grid-item .featured'). text("My Custom Text"); } );
    </script>
    <?php
    }
    add_action( 'wp_footer', 'update_ribbon_text' );

  • Benny
    Newbie 2 points
    April 6, 2019 at 3:46 am

    I use your second option and it work now, James! Thanks for help.

  • JamesD
    JamesD
    Super Guru 1,345 points
    April 6, 2019 at 3:51 am

    You’re welcome Benny, glad it helped.

Viewing 12 posts - 1 through 12 (of 12 total)