pedjas
Member
Posted 5 months ago #
I use some plugin that appends stuff into page. I want to recognize when site is viewed in mobile version and avoid appending additional contents.
I lurked through wordpress-mobile-pack but could not find if it sets some flag to let know other plugins that it is in mobile state.
Any help?
http://wordpress.org/extend/plugins/wordpress-mobile-pack/
anirudh2708
Member
Posted 5 months ago #
Hello pedjas, could you please post the link to your blog here? I can help you from there.
Cheers.
pedjas
Member
Posted 5 months ago #
anirudh2708
Member
Posted 5 months ago #
Hello @pedjas, I am not quite sure I follow what you are looking for. Are you looking for a plugin so that you can view the given url on your handheld device?
Cheers.
pedjas
Member
Posted 5 months ago #
I use WordPress Mobile Pack, and I am trying to make other plugin that I wrote to insert additional contents on bottom of each post, to skip inserting when mobile version is displayed.
anirudh2708
Member
Posted 5 months ago #
Ok, so you are looking for another plugin to install so that you can avail the features you just mentioned, I hope I have got you right this time.
pedjas
Member
Posted 5 months ago #
No, I already have all plugins I want. All I need is it to set my plugin to skip inserting contents when site is displayed in mobile mode.
anirudh2708
Member
Posted 5 months ago #
Alright, I understand. I am sorry, I cannot help you with this. I thought you were looking for another plugin. I hope you find a solution soon. Good luck.
Cheers.
GeertDD
Member
Posted 4 months ago #
add_action('init', 'gdd_update_content_for_mobile');
function gdd_update_content_for_mobile()
{
// WordPress Mobile Pack plugin is required to do this check.
if ( ! function_exists('wpmp_switcher_outcome'))
return;
// Are we using a mobile theme?
if (wpmp_switcher_outcome() === WPMP_SWITCHER_MOBILE_PAGE)
{
add_filter('the_content', '___');
}
}