date_query \ select options

I’m trying to modify the wordpress plugin ‘Genesis Sandbox Featured Content Widget’
so that it uses date_query when querying posts. the code I’ve got is

` [php]date_query’ => array(
‘label’ => __( ‘Date Range’, ‘gsfc’ ),
‘description’ => ‘show posts made before or after a selected time frame’,
‘type’ => ‘select’,
‘options’ => array(
‘’ => __( ‘Select’, ‘gsfc’ ),

        'after' => '1 day ago',  __( 'After 1 day ago', 'gsfc' ),
        'after' => '1 week ago', __( 'After 1 week ago', 'gsfc' ),
		'after' => '1 month ago', __( 'After 1 month ago', 'gsfc' ),
		'after' => '1 year ago' , __( 'After 1 year ago', 'gsfc' ),
		'before' => '1 day ago', __( 'Before 1 day ago', 'gsfc' ),
		'before' => '1 week ago', __( 'Before 1 week ago', 'gsfc' ),
		'before' => '1 month ago', __( 'Before 1 month', 'gsfc' ),
		'before' => '1 year ago',  __( 'Before 1 year ago', 'gsfc' ),
		
		
		),
		),[/php]

I’m using print_r to show how the query is being run and its output is:
Array ( [post_type] => post [posts_per_page] => 5 [orderby] => date [order] => ASC => 1 [meta_key] => [paged] => )

as i switch between date ranges it will return => 2, => 3 etc… I don’t know why its not working.

here is a screenshot of the form on the admin side, which is also not displaying correctly. http://s17.postimg.org/asf1pjhmn/daterange.jpg
its displaying two extra ‘1 year ago’ text.

I’ve tried searching for similar examples to see what I’m doing wrong but i can’t find anything. any help is greatly appreciated.

Well, Jesse, I am very experienced in finding solutions when they are hidden away on the net.
This one has no answer. I looked everywhere. I found lots of possible answers but, none really fit
your exact problem…

I looked at the source a bit of the Widget and nothing jumped out without a lot of studying. Therefore, I
think it is best for you to open a TICKET for a problem issue with the writers of it. Here is a link to the
GitHub page where the Widget is sourced. Most of the GitHub mods answer within a day or two. But, I do
not know this Widget myself, so not sure.

Anyway, here is the link. Press the green “New Issue” button and fill in an error ticket. Perhaps they
can help. I noticed you posted on other sites and they did not have any help to give you. I am very
sorry we could not help you here, but, at least we can steer you to the owners and their ticket logs.

Good luck and let us know if they solve it for you!
https://github.com/wpsmith/genesis-sandbox-featured-content-widget/issues

Sponsor our Newsletter | Privacy Policy | Terms of Service