Last active
February 13, 2018 06:19
-
-
Save cdils/5521415 to your computer and use it in GitHub Desktop.
This snippet can be added to single-listings.php (used with AgentPress Listings and the AgentPress theme to add some extra nav links above and below the single listing content. You'll need to add corresponding CSS to style the output.
This file contains hidden or 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 | |
/** | |
* Add Extra Action Links to Single Listings | |
* | |
* @author Carrie Dils | |
* @link http://www.carriedils.com/ | |
*/ | |
function cd_listing_extras() { | |
$listing_extras = '<div class="listing-extras"><ul>'; | |
// Print friendly link | |
$listing_extras .= '<li><a href="' . get_permalink() . '?class=print">Print Flier</a></li>'; | |
// Back to all listings link | |
$listing_extras .= '<li><a href="' . get_site_url() . '/listings/">Return to listings</a></li>'; | |
$listing_extras .='</ul></div>'; | |
echo $listing_extras; | |
} | |
// Add the extras above the post content | |
add_action('genesis_before_post_content', 'cd_listing_extras'); | |
// Add the extras below the post content | |
add_action('genesis_after_post_content', 'cd_listing_extras'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment