WordPress.org

Ready to get started?Download WordPress

Forums

WordPress Mobile Pack
How to recognize mobile state in the_content filter (9 posts)

  1. pedjas
    Member
    Posted 2 years 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/

  2. anirudh2708
    Member
    Posted 2 years ago #

    Hello pedjas, could you please post the link to your blog here? I can help you from there.

    Cheers.

  3. pedjas
    Member
    Posted 2 years ago #

  4. anirudh2708
    Member
    Posted 2 years 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.

  5. pedjas
    Member
    Posted 2 years 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.

  6. anirudh2708
    Member
    Posted 2 years 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.

  7. pedjas
    Member
    Posted 2 years 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.

  8. anirudh2708
    Member
    Posted 2 years 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.

  9. GeertDD
    Member
    Posted 2 years 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', '___');
    	}
    }

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic