Title: after not creating date query
Last modified: December 7, 2017

---

# after not creating date query

 *  Resolved [stefanr](https://wordpress.org/support/users/stefanr/)
 * (@stefanr)
 * [8 years, 6 months ago](https://wordpress.org/support/topic/after-not-creating-date-query/)
 * Hi,
    I cannot get the ‘after’ parameter to work. I am creating a shortcode with
   the text **after=’30 days ago’** – I can see that a date query is created in 
   the query args, but it is an empty arrary.
 * I am running version 0.74.2 of the plugin. Looking at the code in lcp-parameters.
   php I think the problem lies in the following piece of code (starting on line
   326)
 *     ```
            *  Check which paramaters are set and find out which subarrays
            *  should be created.
            */
           foreach ($params_set as $key=>$value){
             if ( isset($this->{$key}) ){
               $params_set[$key] = true;
               $trutify = substr($key, 0, strpos( $key, '_') );
               ${$trutify} = true;
             }
           }
       ```
   
 * I think that is the parameter is merely ‘after’ rather then ‘after_year’ etc.
   then the $trutify string is blank and no query is created for ‘after’.
 * I have managed to get things working by temporarily amending the code as follows:
 *     ```
            *  Check which paramaters are set and find out which subarrays
            *  should be created.
            */
           foreach ($params_set as $key=>$value){
             if ( isset($this->{$key}) ){
               $params_set[$key] = true;
       		if (strpos( $key, '_') === false){
       			$trutify = $key;	
       			}
       		else {
       			$trutify = substr($key, 0, strpos( $key, '_') );
       			}
               ${$trutify} = true;
       		}
           }
       ```
   
 * This is now working for me, but it will be overwritten the next time the plugin
   is updated.

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

 *  Plugin Contributor [zymeth25](https://wordpress.org/support/users/zymeth25/)
 * (@zymeth25)
 * [8 years, 2 months ago](https://wordpress.org/support/topic/after-not-creating-date-query/#post-10103669)
 * Fixed in v0.76
 * Many thanks for reporting this [@stefanr](https://wordpress.org/support/users/stefanr/)
   🙂
 *  Thread Starter [stefanr](https://wordpress.org/support/users/stefanr/)
 * (@stefanr)
 * [8 years, 2 months ago](https://wordpress.org/support/topic/after-not-creating-date-query/#post-10103879)
 * No problem – and your fix was far more elegant than my code 🙂

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

The topic ‘after not creating date query’ is closed to new replies.

 * ![](https://ps.w.org/list-category-posts/assets/icon-256x256.png?rev=2517221)
 * [List category posts](https://wordpress.org/plugins/list-category-posts/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/list-category-posts/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/list-category-posts/)
 * [Active Topics](https://wordpress.org/support/plugin/list-category-posts/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/list-category-posts/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/list-category-posts/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [stefanr](https://wordpress.org/support/users/stefanr/)
 * Last activity: [8 years, 2 months ago](https://wordpress.org/support/topic/after-not-creating-date-query/#post-10103879)
 * Status: resolved