Skip to content

Instantly share code, notes, and snippets.

@JoeHana
Last active February 24, 2017 04:04
Show Gist options
  • Save JoeHana/3e27f2cd38ab9b86d47362d289941013 to your computer and use it in GitHub Desktop.
Save JoeHana/3e27f2cd38ab9b86d47362d289941013 to your computer and use it in GitHub Desktop.
Change Archive Title
<?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