I'm a beginner, and not very well versed with Wordpress.

This is my setup - I have plugins Pods Admin (for custom post types and custom taxonomies), and Page Builder by SiteOrigin (for creating my wordpress pages).

I have a custom post type called 'documents'. This has a custom taxonomy attached to it called 'products'.

What I am trying to achieve is, have a page with a list of products, and on clicking on a product, see the related documents.

I am struggling with knowing which product the user has clicked on (on page 1) to show the relevant documents (on page 2).

I have gotten as far as having the term ID of the clicked product on the URL of page 2. e.g. www.example.com/documents-page/56 i.e. 56 being the term id of the clicked product on page 1. How do I read the URL of page 2?

Or, is there any simpler way of achieving what I want?


Your list of products is a list of taxonomy terms.

You can get this list with those functions:

get_terms($args) — Retrieve the terms in a given taxonomy or list of taxonomies. get_the_terms($post, $taxonomy) — Retrieve the terms of the taxonomy that are attached to the post.

Clicking on a Product — is opening a custom taxonomy archive page.

See documentation for details.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.