JoeHana
2/24/2017 - 4:04 AM

Change Archive Title

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;
  
}