How to change the listings slug in AgentPress Listing Plugin?

One customer asked this:

I’m also looking to change the name of the “listings” slug. Is this possible with this plugin? Currently my listing slug is site.com/listings and I’d like it to be site.com/properties-for-sale.

Very easy way you can change the slug for your listings. AgentPress Listings Plugin has a filter agentpress_listings_post_type_args. Using this you can change the any element of “listings” post type.

Step 1: Add this small script in your functions.php file

add_filter( 'agentpress_listings_post_type_args', 'gd_listing_custom_slug' );
function gd_listing_custom_slug( $args) {

  $args['rewrite'] = array('slug' => 'properties-for-sale' );  
  return $args;
   
}

Step 2: Flush your permalink structure.

  • Navigate to Dashboard > Settings > Permalink page
  • Click on “Save Changes” button

Now refresh your website and click on “view listing” button or “listings title”. You will get the new slug for your listings.

Share This Article

Subscribe Membership Plan ($9.99/mo)

  • Get full access to all premium tutorials
  • Get Support for the posted content
  • Request for specific how-to tutorials
  • Cancel the subscription at anytime

Reader Interactions

8 Discussion to This Post

  1. Hi, I’m a beginner on this. I would like to know how to display properties sorted by price, taking into account the type of currency, (USD or $ agentino).
    Do you have an example please??

  2. Hello Chinmoy

    Any idea why this code for changing the post type slug is working under functions.php but not with genesis simple hooks?

    Daniel

      • Maybe because the change concerns the backend, and genesis visual hooks plugin covers the frontend only?

  3. Hey, I have a problem with the “View Listing” text. The page i’m doing is in spanish, therefore I need the text to be in spanish. I purchase your plugin, the Extendend AgentPress Listing, but, I noticed that the function gettext() doesn’t work. Any idea how can I put another text instead of that?

    Thanks by the way!

  4. I do need to ask for you help, and if what I’m asking requires payment, please provide a quote.

    Please see my Extended AgentPress Listings install at
    http://www.queretarohomerentals.com

    You’ll see that I’m running your great Extended AgentPress Listings widget. I’ve successfully edited the widget in the html area to get what I wanted showing in the featured post area.

    I also changed the functions.php file in order to change the display on property pages, deleting some items like address, zip, MLS#, etc. and deleting items in the right array (which seems to throw off subsequent text entries in the property listings, though that’s not a biggie).

    MY EDIT:
    ==========
    add_filter( ‘agentpress_property_details’, ‘custom_agentpress_property_details_filter’ );

    function custom_agentpress_property_details_filter( $details ) {

    $details[‘col1’] = array(
    __( ‘Price:’, ‘apl’ ) => ‘_listing_price’,
    __( ‘Square Feet:’, ‘apl’ ) => ‘_listing_sqft’,
    __( ‘Bedrooms:’, ‘apl’ ) => ‘_listing_bedrooms’,
    __( ‘Bathrooms:’, ‘apl’ ) => ‘_listing_bathrooms’,
    );

    $details[‘col2’] = array(
    );

    return $details;

    }
    ======

    But my main problem is back on the front page. I created a “search” link in the top menu which goes to “http://www.queretarohomerentals.com/listings/“ and the # of bedrooms and bathrooms isn’t appearing there. Likely there is some other php file which I need to edit in order to substitute for the “dropped fields” of ‘Address:’, ‘City:’, etc. I’ve searched the php files for “‘Address:’ etc. and am not sure which file I might consider editing. Any help wold be much appreciated.

    My goal is to have appear on all properties displayed with “mysite/listings” the same display as I’ve achieved with your great widget on the front page:
    * title in red at top
    in white:
    * price
    * bedrooms, bathrooms (or some other single text field)

    Maybe this can be achieved with some other plugin of yours?

    Care and appreciation,

    Steve Iman
    sciman@cpp.edu

    • Hi

      Thank you for purchasing my plugin. In your child theme folder have archive-listings.php file. You will modify that file. Find out this function ‘agentpress_listing_archive_loop’ and edit the inside’s code.

      Cheers
      Chinmoy

Leave A Reply

Your email address will not be published. Required fields are marked *