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
1 2 3 4 5 6 7 |
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.
Dennis says
Thank you so much, I’ve been desperately searching for a solution on this on the plugin forum and then found your website! Worked perfectly. You are one of the reasons, why the internet is still great!
Nguyễn Đạt Tài says
Hi Paul,
Should I change Additional Features slug?
Ex: https://demo.studiopress.com/agentpress/features/basement/
Chinmoy Paul says
You can follow this guide line https://wordpress.stackexchange.com/questions/161788/how-to-modify-a-taxonomy-thats-already-registered
Nguyễn Đạt Tài says
Thanks you so much.
Tamas says
Thank you, works perfectly :Ö
Jeffrey says
Hi is there a way to change the features slug also?
Thanks in advance.
Jeffrey
Nguyễn Đạt Tài says
I wonder this question too.
Juan Pablo says
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??
Daniel Hoefter says
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
Paul says
May be priority issue.
Daniel Hoefter says
Maybe because the change concerns the backend, and genesis visual hooks plugin covers the frontend only?
Fullstack says
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!
Paul says
Are you tried this https://paulchinmoy.com/how-to-change-the-view-listing-text-agentpress-listings-plugin/? Also you will add new textdomain ‘eaplw’ in your code.
Stephen says
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
Paul says
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