Last active
August 29, 2015 14:14
-
-
Save zackkatz/ca5d903449390c1dd0ea to your computer and use it in GitHub Desktop.
Add code inside listing wrapper to achieve http://codepen.io/anon/pen/pvPaaW
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* Plugin Name: IDX+ - Insert Ribbon HTML Into Listings | |
* Description: Print the ribbon HTML inside the listing wrapper for search results | |
* Version: 1.0 | |
* Author: Katz Web Services, Inc. | |
* Author URI: http://www.idxplus.net | |
*/ | |
// Available since IDX+ 2.4 | |
add_action('idx_plus_results_before_listing', 'skyvillage_add_ribbon_to_listing' ); | |
/** | |
* Print the ribbon HTML inside the listing wrapper | |
* | |
* @param array $listing Array of listing data, like price, lot size, etc. | |
*/ | |
function skyvillage_add_ribbon_to_listing( $listing = array() ) { | |
// Not sold | |
if( !isset( $listing['status'] ) || strtolower( $listing['status'] ) !== 'sold' ) { | |
return; | |
} | |
// The rest is sold | |
?> | |
<!-- You can insert HTML code here --> | |
<div class="corner-ribbon top-left sticky red">Sold</div> | |
<!-- /end new code --> | |
<?php | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment