Change the View Listing Text in AgentPress Listings Widget

To add listings to the Agentpress pro themes front page, you need to install and setup the AgentPress Listings plugin.

This plugin generates a widget which is generally added to the themes front page widget areas.

If you want to change the View Listings text for each listing, you will need to add custom code to the themes functions file. If you edit the plugins file to change the text, it will be overwritten when you update the plugin so it’s not best practice to do that.

Here’s the text in red which this solution enables you to modify:

listings-widget

If you need to modify the View listings text on the archive page, you can simply do that in the child themes archive-listings.php file however this only effects the archive and not the front page which uses the widget to add the listings.

Note: The code doesn’t only enable you to change the view listing link text. It also enables you to change all the PHP functionality and classes generated by the widget for the entire custom loop included in the plugin.

The entire output generated by the widget can be modified to your own requirements.

Here’s the code you simply copy & paste to the end of your child themes functions file:

Related Tutorials


Comments

8 responses to “Change the View Listing Text in AgentPress Listings Widget”

  1. Krisztian Berg Avatar
    Krisztian Berg

    Hello Brad,

    Thank you your reply!

    WP Version: 5.5.3
    Theme:
    AgentPress Pro Theme

    Plugins:
    AgentPress Listings
    Extended AgentPress Listings Widget

    Problems:
    1) Change “Listing view” text to an other (Hungarian: További adatok) on Frontpage.
    2) Translate and costumize the AgentPress Listings “Property Details” attribute:
    Price, Address, City, State, ZIP, MLS #, Square Feet, Bedrooms, Bathrooms, Basement

    Do you have an idea?

    1. 1. & 2. You can use the first code snippet in the functions.php file from the download folder to do all of this.

      1. Krisztian Berg Avatar
        Krisztian Berg

        Dear Brad,
        Thank you your email.

        WP debug mode messages:

        1.
        Deprecated: Unparenthesized `a ? b : c ? d : e` is deprecated. Use either `(a ? b : c) ? d : e` or `a ? b : (c ? d : e)` in /home/MyServer/MyDomain.hu/wp-content/plugins/styler-for-wpforms/helpers/utils/class-sfwf-review.php on line 265

        2.
        Fatal error: Cannot redeclare change_link_text() (previously declared in /home/MyServer/MyDomain.hu/wp-content/themes/agentpress-pro/functions.php:220) in /home/MyServer/MyDomain.hu/wp-content/themes/agentpress-pro/archive-listing.php on line 117

        Could you help me?

        Regards,

        Krisztian

        1. 1. This error relates to the styler for wp forms plugin and has nothing to do with my code.
          2. The 2nd error means you have added the code twice. You don’t need to add it in archive-listing.php as you can simply modify the code which already exists in that file. Please remove the other code or send me FTP/cPanel access and i’ll install the code for you.

          I assume you want to modify the the text used by the widget or did you want to modify the text on the archive page or both? Please link to the page in question.

          1. Krisztian Berg Avatar
            Krisztian Berg

            Dear Brad,

            I troubleshot my mistake. But don’t working the translation.

            1)
            I need in the front page change the English text:
            screenshot picture: https://ibb.co/PMn9NjM

            I need translate in editor page the English text:
            screenshot picture: https://ibb.co/tb2jbVT

            2) I have an working solution in only listing pages
            I use this only here:
            plugins/agentpress-listings/includes/functions.php

            Do you have any solution?

            Regards,

            Krisztian

          2. There’s 2 code snippets you need.

            1. The 1st code snippet is already included in your functions.php. The function name is agentpress_property_details_filter. You can modify the default text included in this code to translate your language. This code modifies the property details on the single listing edit screen.

            2. The 2nd code snippet is included in the download folder and is the 2nd code snippet on the functions file. The function name for the code is modify_view_listings_text.

            NOTE : Do not use any of these code snippets more than once otherwise you will get an error unless they use unique function names. Also, do NOT use any plugin to modify any text or property details otherwise the code may not work.

            I will email you the 2 code snippets you are supposed to be using however note that 1 is already included in your functions file by default.

  2. Krisztian Berg Avatar
    Krisztian Berg

    The solution is NOT working.
    Could you please publish/or send me a working code?

    1. Hello Krisztian. Which theme are you using? I just tested the code in AP and it works. It modifies the View Listing text for entries using the Listings widget. If you want to modify entries on archives, you can modify the text in line 89 of archive-listing.php or send me FTP access and i’ll do it for you. Note : I used the 2nd code snippet in the functions.php file from the download folder, do not use both solutions, only 1.

      Also, if you use a plugin or code which uses the same filter, the code will not work so only use 1 solution.

Leave a Reply

Join 5000+ Followers

Get The Latest Free & Premium Tutorials Delivered The Second They’re Published.