Forum Replies Created
-
AuthorPosts
-
February 4, 2016 at 6:44 am in reply to: "events_get_listview_link" leads to "Page Not Found" #1067673
Erik
ParticipantHi Cliff,
The “tribe_get_listview_link()” didn’t work since listview was not activated in the calendar settings. This resolves my main question but I still have one minor detailed that you might give me a suggestion for…
Since I had to activate the listview, the view-menu/dropdown now appears. Thats fine, but in my mobile view the script prevents users to accually choose the calendar view. I therefore would like it to be hidden in mobile view. How might I acchive that?
Thanks for your support.
/Erik
February 4, 2016 at 5:39 am in reply to: "events_get_listview_link" leads to "Page Not Found" #1067453Erik
ParticipantHi Cliff,
Thanks for your suggestion. I have added your code-snippet but still no change.
When I, for testing, use a common “wp_redirect( ‘http://www.google.se/’ );” in the snippet, the user is correctly redirected in mobile mode and not in desktop This must mean that the “wp_is_mobile” is working correctly. In other words, I belive it’s the “tribe_get_listview_link()” that does not work as expected.
/Erik
February 4, 2016 at 3:17 am in reply to: "events_get_listview_link" leads to "Page Not Found" #1067423Erik
ParticipantHi Cliff,
Unfortunately it doesnt work with tribe_get_listview_link() either. I missed to mention that that was the redirect I initialy tried to use.
This is what the code looks like right now in my functions.php:
add_action( ‘template_redirect’, ‘tec_mobile_template_redirect’ );
function tec_mobile_template_redirect() {
if( tribe_is_month() && wp_is_mobile() ) {
wp_redirect( tribe_get_listview_link() );
//wp_redirect( ‘http://www.google.se/’ );
exit();
}
}And this is the URL (with the “page not found” in mobile):
/Erik
-
AuthorPosts
