Changing result’s title based on filter selection ?
-
Hey there, I am really happy with the plugin. I have a quick question regarding the title of the page based on results.
I have 2 taxonomies, tax1 : tax2
tax1 has two terms tax1tem1, tax1term2
tax2 has 8 terms and so on.I would like to show specific title on result pages. this is what I ve tried but ;
if( is_tax('tax1') && !is_tax('tax2') ) { $tax1term = get_term_by( 'slug', get_query_var( 'term' ), 'tax1' ); echo $tax1term->name; echo $tax1term->description; }elseif(is_tax('tax1') && is_tax('tax2')){ $tax1term = get_term_by( 'slug', get_query_var( 'term' ), 'tax1' ); $tax2term = get_term_by( 'slug', get_query_var( 'term' ), 'tax2' ); echo $tax2term->name; echo $tax2term->description; }
so basically I land on the post archive page with the filter on.
If I select no tax1 and select tax2 = show tax2 as title
If i select tax1 and no tax2 = show tax1 as title
If I select tax1 and tax2 at the same time = show tax2 as title and tax1 as subtitleIs there a clean way of doing this?
Viewing 11 replies - 1 through 11 (of 11 total)
Viewing 11 replies - 1 through 11 (of 11 total)
- The topic ‘Changing result’s title based on filter selection ?’ is closed to new replies.