Last active
February 24, 2017 04:04
-
-
Save JoeHana/3e27f2cd38ab9b86d47362d289941013 to your computer and use it in GitHub Desktop.
Change Archive Title
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 | |
/** | |
* Change Archive Title | |
*/ | |
add_filter( 'wpsight_get_archive_title', 'custom_get_archive_title', 100 ); | |
function custom_get_archive_title() { | |
global $wp_query, $wpsight_query; | |
if ( isset( $wpsight_query->found_posts ) ) { | |
$title = '<span class="listings-panel-found">' . $wpsight_query->found_posts . '</span>' . ' ' . _nx( 'Listing', 'Listings', intval( $wpsight_query->found_posts ), 'archive title', 'wpcasa' ); | |
} elseif ( isset( $wp_query->found_posts ) ) { | |
$title = '<span class="listings-panel-found">' . $wp_query->found_posts . '</span>' . ' ' . _nx( 'Listing', 'Listings', intval( $wp_query->found_posts ), 'archive title', 'wpcasa' ); | |
} else { | |
$title = __( 'Listings', 'wpcasa' ); | |
} | |
return $title; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment