i have read many tutorials passing multiple variables post/page in wordpress, using add_rewrite_endpoint. passing 2 variables, calendar_year / calendar_month . works both separately each one. using both (http://myserver/mysite/availability/calendar_year/2016/calendar_month/10/) gets year , if pass them on reverse, gets month. availability page shows correct (no 404 error), fails taking last parameter when there 2 of them. here code add_rewrite_endpoint
function booking_calendar_add_endpoints() { add_rewrite_endpoint('calendar_year', ep_all); add_rewrite_endpoint('calendar_month', ep_all); } add_action('init','booking_calendar_add_endpoints'); and how , use it:
global $wp_query; $year_var = $wp_query->get( 'calendar_year' ); $month_var = $wp_query->get( 'calendar_month' ); i sure missing something. have solution it? thanks.
Comments
Post a Comment