Hi,
Sorry I lost track of this thread. The title can be manipulated with the the_title
filter, which is a WordPress default thing; or you can use a custom A-Z Listing template page by copying the file from wp-content/plugins/a-z-listing/templates/a-z-listing.php
into your theme alongside the style.css
. In the custom template you will want to replace:
<?php $a_z_listing->the_title(); ?>
With something like this:
<?php
$title = $a_z_listing->get_the_title();
$post = $a_z_listing->get_the_item_object( 'I understand the issues!' );
$title = preg_replace( '/^' . $post->post_name . '/i', $title );
echo $title;
?>
Note the text 'I understand the issues!'
must state exactly that, and indicates that you’re aware that using the feature on larger listings (more posts) may be slow or break the page entirely with memory exhaustion or timeouts.
If you go the the_title
route you want to do something like this in your functions.php
file:
add_filter( 'the_title', 'override_a_z_titles', 10, 2 );
function override_a_z_titles( $title, $post_id ) {
if ( ! is_page( $page_id_or_title_or_slug_of_a_z_listing_page ) ) {
return $old_title;
}
$post = get_post( $post_id );
$title = preg_replace( '/^' . $post->post_name . '/i', '', $title );
return $title;
}
The big caveat is I have written this from memory, without double checking that either example is correctly coded.