AND filter by multiple categories (revisited)
-
I’ve been researching using a logical ‘AND’ in the shortcode to use two categories to control visibility of links, I ran across a thread here that offered two code additions to enable this. I tried each of these and was not able to get either of these to ‘AND’ two categories. I’m using Simple Links version 4.1.1 and WP version 4.9.4.
I added each of the code additions to my subthemes’ template.php file and verified that they are being loaded (I added some output to the added code to verify they are being loaded). For neither of these solutions was I able to get anything to work.
Suggested Solution #1
First I tried the solution found here:
https://www.ads-software.com/support/topic/and-filter-by-multiple-categories/#post-5293744.I added the both_categories=”1″ to the shortcode to get the following shortcode:
[simple-links description = “true” category = “Press Page Links,Left Column” both_categories = “1”]When I add the both_categories=”1″ to the shortcode, I get no links output even though I have both the categories attached to the links. I would expect this code to interpret the shortcode as “display any link that has both ‘Press Page Links’ AND ‘Left Column’ specified for it”. I get no output when the both_categories is specified.
Suggested Solution #2
So, when this appeared to not work, I tried this solution here:
https://www.ads-software.com/support/topic/and-filter-by-multiple-categories/#post-5293708I wasn’t able to get anything to work with Solution #2.
So…any direction on this would be great.
Thanks.
- The topic ‘AND filter by multiple categories (revisited)’ is closed to new replies.