Hi Gilad.
That makes things somewhat more complicated. The current solution works by going to an alphabet taxonomy archive when you select a letter, but you are coming from—and want to stay on—a different taxonomy archive (the USA sub-category, for example).
I re-worked this in my test site and got it working, although it took a little doing, and required me to register a custom shortcode which I'll describe below.
You can see the results in the revised screen recording, where I am on a film genre archive, and stay on it as I use the letter 'filters'.
So, we still have the alphabet taxonomy which you need to assign to your posts.
We need to modify the alphabet terms view that generates the alphabet filters, because we don't want the links to go to the alphabet taxonomy archive anymore, we want to stay on the (in the case of my test site) genre taxonomy archive, but add an additional query filter for the alphabet term. We'll pass the alphabet term (the letter) using a url parameter.
(So, in my screen recording I am initially on the drama genre archive, and once I click a letter I stay on the same page but am additionally filtering by the alphabet archive.)
So the loop output section of my alphabet view now looks like this:
[wpv-layout-start]
[wpv-items-found]
<a href="[current_url]">All</a>
<!-- wpv-loop-start -->
<wpv-loop>
<a href="[wpv-post-taxonomy type='genre' format='url']?wpvalphabet=[wpv-taxonomy-title]">[wpv-taxonomy-title]</a>
</wpv-loop>
<!-- wpv-loop-end -->
[/wpv-items-found]
[wpv-no-items-found]
<strong>[wpml-string context="wpv-views"]No items found[/wpml-string]</strong>
[/wpv-no-items-found]
[wpv-layout-end]
You'll note that I added a link to "All", to not filter by any letter, which is where I resorted to a custom shortcode, but I'll come back to that at the end.
The key change is in what's inside the wpv-loop tags. Now I am manually building the link, which will keep me on the same page, but which adds the letter as a url parameter 'wpvalphabet'.
Because of how I had this set up before I didn't have a custom archive for the genre taxonomy, so I needed to go ahead and create that now. That is what lists the matching films when I visit a url such as mysite.com/genre/drama.
Now I add a Query Filter to this archive which is a Taxonomy filter for the alphabet taxonomy where the value is set by the url parameter wpvalphabet (see screenshot).
In the output section I need to add my alphabet terms view before the wpv-loop tags, like so:
[wpv-layout-start]
[wpv-items-found]
[wpv-view name="alphabet-terms"]
<!-- wpv-loop-start -->
<wpv-loop>
<h3>[wpv-post-link]</h3>
</wpv-loop>
<!-- wpv-loop-end -->
[/wpv-items-found]
[wpv-no-items-found]
<strong>[wpml-string context="wpv-views"]No items found[/wpml-string]</strong>
[/wpv-no-items-found]
[wpv-layout-end]
The result is as per my screen recording.
A tricky part was the url for the 'All' link, for which I wrote a small custom shortcode that outputs the current url minus any url parameters. You'll need to add the following to your functions.php file or using a plugin such as Code Snippets.
/**
* Register custom shortcode to output url of current page
* Minus any url parameters
*/
add_shortcode( 'current_url', function(){
$request = $_SERVER['HTTP_HOST'].strtok($_SERVER["REQUEST_URI"],'?');
$protocol = '<em><u>hidden link</u></em>';
if ( $_SERVER['HTTPS'] ) {
$protocol = '<em><u>hidden link</u></em>';
}
return $protocol . $request;
} );
There is quite a lot to digest there, but you should have everything you need to implement it on your own site.
Good luck!