Add a specific part of current category page url to shortcode


I have the following URL:, where xyz can be hundreds of different words.
I use a table plugin for displaying my content all throughout the website, and I want it to filter me categories on each category pages as well. The table works with shortcodes, as follows: [tableshortcode id="120" filter=’xyz’].

I would like to place the category id of the current url, into the filter part of the shortcode.
Right now I’m only able pull the shortcode with the following code:

<?php echo do_shortcode("[tableshortcode id="120" filter='xyz']"); ?>

Any answers, solutions would be much appreciated.

KrisV 2 years 2020-12-27T06:11:09-05:00 0 Answers 4 views 0

Leave an answer