![]() |
Hi There,
I have to display posts dependent on what category slug the user is on.
For example:
- If the user is on a page www.me.com/topic/wheels. Then they will only see posts of topic wheels.
- If the user is on a page www.me.com/topic/rubber. Then they will only see posts of topic rubber.
Since there are 100's of topics - I would need a code snippet that retrieves the current url topic slug and then displays the posts associate to that current url topic slug.
Below is what I had in mind but not sure if this is the best way of doing this:
Solution - 1Please try this
Solution - 2Hi, you can use Tags as Topic set Tag base = topic under Settings - Permalinks menu https://your-domain/wp-admin/options-permalink.php Solution - 3This is how WordPress works actually. Are you using the archive taxonomy? There you will have it done. |
Wordpress |
Type: | Code Example |
Category: | Coding |
Sub Category: | Code Example |
Uploaded by: | Admin |
Views: | 27 |