Home › Forums › General Issues › categorize post by month whit date picker
i want categorize by month with date picker
for exapmle:
-Months select-
jan ===-click-====>(show All post of january, and hide the other post.)
feb *
mar *
etc.. *
————— *
*
<post of january only>
of course, according only of datepicker value in the custom post type,
some idea?

http://codex.wordpress.org/Class_Reference/WP_Meta_Query
if (isset($_GET['month'])):
$args = array(
'post_type' => 'any',
'meta_query' => array(
array(
'key' => 'YourAcfDateFieldKey',
'value' => $_GET['month'],
'compare' => 'LIKE'
)
)
);
$myposts = get_posts($args);
endif;
try something like that
is good, but no get the variable month in the the datepicker, i’ve tried print the
value whit echo but no display the array of months, and i’ve tried a assign a url in the event page to the single:
myweb.com/event/?month=september
but is not enough

my code was just for example, you can add event listener onchange to your datepicker so when it will change pass to url with get parameter and modify the WP_Query object acording the request

I’m not really sure what you trying to do, so just offering methods

also you can load all post into page and then sort em using jQuery using datepicker as sorting data provider for example
The topic ‘categorize post by month whit date picker’ is closed to new replies.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.