This file enables you to modify the AgentPress listings plugins property details shortcode function included in the plugins class-agentpress-listings.php file.
This file is modified in your AgentPress Pro child theme folder so any modification you make to the property_details_shortcode( $atts )
function is not lost when the plugin is updated.
The file in this download folder enables you to safely modify :
- The markup for the property details shortcode enabling you to remove HTML tags and replace them with classes for styling both the label and value for each property value.
- Remove any labels when no value is added in the listings details metabox input fields on the single listing admin page.
- Remove the label for the Additional Features if none added.
Here’s an example where the markup has been removed and replaced with custom classes enabling the use of CSS Grid to display property details in table like columns if the value field is not empty.
Demo Video
Shows the markup and output for the AgentPress Listings plugins shortcodenm modified via the AgentPress Pro child theme.
The code only executes when the AgentPress Listings plugin is active.
Installation Steps
- # Upload the file named agentpress-shortcode.php to your AgentPress Pro theme folder like this :
- # Copy & paste the PHP code ( without the opening PHP tag ) from functions.php to the end of your AgentPress Pro themes functions file.
Optional – Example HTML & CSS
You can then copy & paste the CSS from the style.css file to the end of your AgentPress Pro themes style sheet and clear caching. This is demo CSS which produces what you see in the screenshot at the beginning of this tutorial.
Also add this HTML to your editor on the Single Listings Edit screen as seen in the demo video.
It worked but all markup has been removed and replaced with custom classes. even the featured image is displayed in half now. Looks ok in mobile devices but not on desktop.
See here: https://ibiza.realestate/listings/modern-house-with-sea-views-to-es-vedra/
Yes, thats what its coded to do so you can add your own markup and change the styling for customization as detailed in the tutorial description. If you want to use the default markup, just add it back from the listings plugin.
Hello Brad
The code works except the CSS. Any idea?
Thanks
It depends on how you want to style it. Sample CSS is provided to style the HTML output as seen in the screenshot.
Is it possible to rename the title “Property Details” for something else ?
In the backend?