Title: Filter Shortcode for two values in same column
Last modified: August 21, 2016

---

# Filter Shortcode for two values in same column

 *  Resolved [Tisha Oehmen](https://wordpress.org/support/users/paraduxmedia/)
 * (@paraduxmedia)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/filter-shortcode-for-two-values-in-same-column/)
 * I’m trying to write a shortcode filter that will only display results when they
   match one of two values. I can get the shortcode function to work properly with
   1 value, as follows:
 * `[userlist list=5 filter=show join_date=2012-03]`
 * (join_date is the column I’m trying to filter by.)
 * Is it possible to filter a column as for two values, ie 2012-04,2012-03? ie
    `[
   userlist list=5 filter=show join_date=2012-04,2012-03]` or `[userlist list=5 
   filter=show join_date="2012-04,2012-03"]`
 * Neither of these work, does it have to in an array format? (I’m actually using
   this in a template so can code full PHP if that’s what would be necessary.)
 * Anyone able to do this successfully?
 * [http://wordpress.org/extend/plugins/amr-users/](http://wordpress.org/extend/plugins/amr-users/)

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Thread Starter [Tisha Oehmen](https://wordpress.org/support/users/paraduxmedia/)
 * (@paraduxmedia)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/filter-shortcode-for-two-values-in-same-column/#post-3700032)
 * Nevermind all, I think I figured it out. It should be:
 * `[userlist list=5 fieldnamefilter=join_date, fieldvaluefilter=2012-04,2012-03]`
 *  Thread Starter [Tisha Oehmen](https://wordpress.org/support/users/paraduxmedia/)
 * (@paraduxmedia)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/filter-shortcode-for-two-values-in-same-column/#post-3700034)
 * Problem resolved.
 *  Plugin Author [anmari](https://wordpress.org/support/users/anmari/)
 * (@anmari)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/filter-shortcode-for-two-values-in-same-column/#post-3700188)
 * Hi Tisha,
    I’m happy that you think you resolved your problem.
 * However it sounds like you only have one ‘field’ ie the join date in the column
   and I am wondering why you did not simply configure the list to ‘include’ only
   those dates?
 * or if you insist on having a full list and only sometimes want to filter it (
   eg: front end)
    [http://wpusersplugin.com/2876/simple-column-filtering-in-amr-users-lists/](http://wpusersplugin.com/2876/simple-column-filtering-in-amr-users-lists/)
 * EG: if you only have one field
    [http://directories.wpusersplugin.com/memberdetails/?filter=1&REGION=Africa](http://directories.wpusersplugin.com/memberdetails/?filter=1&REGION=Africa)
 * The ‘fieldvaluefilter’ stuff is ONLY for people who for some weird reason are
   squishing multiple fields into one column and then STILL want to be able to filter
   by part of that column (very confusing…)
 * Field filtering can place a load on your system as it will have to rerun reports
   realtime every page load…
 *  Thread Starter [Tisha Oehmen](https://wordpress.org/support/users/paraduxmedia/)
 * (@paraduxmedia)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/filter-shortcode-for-two-values-in-same-column/#post-3700189)
 * Fair question Anmari, my reason for not including it in the list itself was that
   I wanted to call the only most recent 3 months worth of new members (determined
   by the php call), and I didn’t want to update it every month. The widget I’ve
   constructed uses the following code:
 *     ```
       echo '<h4 class="widgettitle">Welcome Our Newest Members!</h4>';
       $thismonth = date('Y-m');
       $lastmonth = date('Y-m', strtotime("-1 month") ) ;
       $priormonth = date('Y-m', strtotime("-2 month") ) ;
       echo do_shortcode('[userlist list=5 fieldnamefilter=join_date, fieldvaluefilter='.$thismonth.','.$lastmonth.','.$priormonth.']');
       ```
   
 * This seems to work OK, but if you have a better recommendation, I’d be very open
   to using it. Thanks for you efforts creating such a useful plugin!

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Filter Shortcode for two values in same column’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/amr-users_f6f6f4.svg)
 * [amr users](https://wordpress.org/plugins/amr-users/)
 * [Support Threads](https://wordpress.org/support/plugin/amr-users/)
 * [Active Topics](https://wordpress.org/support/plugin/amr-users/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/amr-users/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/amr-users/reviews/)

## Tags

 * [column filter](https://wordpress.org/support/topic-tag/column-filter/)
 * [filter](https://wordpress.org/support/topic-tag/filter/)
 * [shorcode](https://wordpress.org/support/topic-tag/shorcode/)

 * 4 replies
 * 2 participants
 * Last reply from: [Tisha Oehmen](https://wordpress.org/support/users/paraduxmedia/)
 * Last activity: [13 years, 1 month ago](https://wordpress.org/support/topic/filter-shortcode-for-two-values-in-same-column/#post-3700189)
 * Status: resolved