Skip Navigation

[Resolved] taxonomy page search and term page result

This thread is resolved. Here is a description of the problem and solution.

Problem:
The user would like to use links for the custom post taxonomy archive filtered by taxonomy term instead of links to the terms archives.

Solution:
Instead of using the taxonomy term shortcode, build a taxonomy view and build the links as it suits. Check this reply https://toolset.com/forums/topic/taxonomy-page-search-and-term-page-result/#post-1936955

Relevant Documentation:
https://toolset.com/documentation/programmer-reference/views/views-shortcodes/#vf-154400

This support ticket is created 3 years, 11 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 - - 9:00 – 13:00
14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 - - 14:00 – 18:00

Supporter timezone: Africa/Casablanca (GMT+01:00)

This topic contains 9 replies, has 3 voices.

Last updated by kayser 3 years, 11 months ago.

Assisted by: Jamal.

Author
Posts
#1932717

Hi
in this page I have a "thematic" taxonomy with a lot of terms, I can sort them with the drop down menu.
hidden link
if I select one of the results I get to its page
hidden link
but if I select the terms of the taxonomy in this page hidden link
I go back to the taxonomy term page and I no longer have all the terms in the drop-down menu.

how to keep all the terms of the taxonomy in the drop-down menu.

#1933455

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

The first link is a static page that has a search View added, with a filter for the taxonomy.

The problem arises when you navigate to one of the results, and then on the single post page you display the terms as links to the taxonomy archives.

So when you arrive at a link like hidden link you are already inside the archive for the thematique taxonomy, only showing posts with the ciel-etoiles-planetes term.

That is dictated by the URL, which WordPress understands as that particular taxonomy archive.

So you cannot switch to show posts with other terms from the same URL, because that URL is specifically to show posts with the ciel-etoiles-planetes term.

You have two options.

1. Don't use the archives. On your single post template, instead of outputting the terms as links to the archive, construct them as a link back to the original page, with a URL parameter appended for the term in question (to pre-select the term in the dropdown).

2. Do use the archives, but remove the search filter from the archive and replace it with a taxonomy View which you use to construct a dropdown with links to the corresponding archive pages. So instead of searching for other terms within the same term archive, you navigate to that archive.

#1933481

Thank you Nigele
Can I find one of your solutions as an example in discover-wp.com?
because I find it difficult to implement them.
guy

#1936095

Hello guy, I don't think we have any of these suggestions on discover-wp.com

Both suggestions will require using a taxonomy view, that are currently only available in the legacy editor. Select which taxonomy in the content selection section hidden link

For the first suggestion, you need to a Taxonomy term filter set by the current post. hidden link

For the second suggestion, you need to build the URL instead of generating it by Toolset. Something like:

          <a href="<em><u>hidden link</u></em>;">
            [wpv-taxonomy-title]
          </a>

Check this screenshot hidden link

I hope this helps. Let me know if you have any questions.

#1936679
Screenshot_2021-02-07 Edit Content Template ‹ Artistes du Livre — WordPress.png

Thanks Jamal

it's instead of this single field that I have to create this view? (see the picture)
hidden link
Guy

#1936771

Exactly. Remove the Single field block and use a "Fields&Text" block.

First, create the view in the legacy editor. Then insert the view inside this "Fields&Text" block using the view's button or using the following shortcode:

[wpv-view name="name or slug of the taxonomy view"]
#1936799

Jamal is good but still three problem

where to put the comma between the terms?
hidden link

in the drop-down menu I don't have the right font
hidden link

and there I can only get the name of the artist with "work on paper" and not with a book.

[wpv-post-featured-image size="custom" width="200"]

[types field='prenom' item='@oeuvre-sur-papier-artiste.child'][/types] [types field='nom' item='@oeuvre-sur-papier-artiste.child'][/types]

[types field='prenom' item='@livre-artiste.child'][/types] [types field='nom' item='@livre-artiste.child'][/types]

[wpv-post-title]

guy

#1936883

Hello guy! You can put the comma after the link that you built:

<a href="<em><u>hidden link</u></em>;">
  [wpv-taxonomy-title]
</a> , <!-- <== Put the comma here -->

Regarding the font issue on the dropdown, it seems to come from an Astra inline CSS hidden link
It has to be overwritten on the view or on the custom CSS in WordPress customizer.

Regarding the name of the artist, I would suspect that the relationship slug is not correct.

Frankly, I need to know where the code is added, because I am not sure to know. I can check it further if you allow me temporary access to your website. Your next reply will be private to let you share credentials safely. ** Make a database backup before sharing credentials. **

#1936955

Actually, for the comma(,) my suggestion will also print a comma at the end of the line of the taxonomy terms. We need to use the wpv-item shortcode to add comma for all instances except the last one. Check it here hidden link

	<wpv-loop >
      [wpv-item index=other]
		<a href="<em><u>hidden link</u></em>;">
          [wpv-taxonomy-title]
      	</a>, 
      [wpv-item index=last]
		<a href="<em><u>hidden link</u></em>;">
          [wpv-taxonomy-title]
      	</a>
	</wpv-loop>

Which gives hidden link
Read more about the shortcode here https://toolset.com/documentation/programmer-reference/views/views-shortcodes/#vf-154400

However, for support rules, we are able to handle only one issue at a time. This helps us to bring you a better service and also helps other users to find all the information here exposed. For that reason, I have created a new ticket for each of the other issues. I'll be posting my replies there.
- https://toolset.com/forums/topic/different-font-for-the-search-dropdwon/
- https://toolset.com/forums/topic/view-does-not-return-related-posts/

#1937649

My issue is resolved now. Thank you!