Title: Loading Mobile/Desktop Headers Dynamically
Last modified: August 19, 2016

---

# Loading Mobile/Desktop Headers Dynamically

 *  [CK Hicks](https://wordpress.org/support/users/ckhicks/)
 * (@ckhicks)
 * [15 years, 1 month ago](https://wordpress.org/support/topic/loading-mobiledesktop-headers-dynamically/)
 * Greetings,
 * I’m working on a theme framework and need a fresh set of eyes – what are your
   thoughts on the following process:
 * – User agent detected when visitor reaches the site (via: detectmobilebrowser.
   com)
    – Different header information included with simple PHP (files within template
   folder) – Generic closing `</head>` tag and life resumes at normal pace!
 * So the code looks like this:
 * `<?PHP detectmobilebrowsermagic ?>`
    `if mobile useragent: load <html>...</head
   > for mobile users` `else (desktop useragent): load <html>...</head> for desktop
   users`
 * Does this make sense, what are your thoughts on speed vs. functionality, etc.
   I’d love to hear any thoughts or comments on the process! If you’d seen anything
   like this I’d really enjoy reading their documentation as well.
 * Counterpoint – I read this article about using PHP for browser detection, but
   the main argument seems to be centered around “you need to keep it updated” which
   I’m planning on for this framework: [http://www.impressivewebs.com/php-browser-detection/](http://www.impressivewebs.com/php-browser-detection/)
   Can anyone think of another reason why I might not want to keep this function
   within PHP?
 * I think this is a fun way to quickly swap between two versions of the head code
   without a lot of overhead and client-side scripts, which ought to speed up the
   mobile experience quite nicely.
 * Thanks in advance for your thoughts!

Viewing 1 replies (of 1 total)

 *  Thread Starter [CK Hicks](https://wordpress.org/support/users/ckhicks/)
 * (@ckhicks)
 * [15 years, 1 month ago](https://wordpress.org/support/topic/loading-mobiledesktop-headers-dynamically/#post-2027915)
 * Quick note: The idea here is to bypass the need for specific hacks and styles
   on mobile vs. desktop environments, because the header will only have the necessary
   scripts for each platform. (I’m using both the mobile/desktop version of HTML5
   Boilerplate for testing purposes.) The main idea is only showin the users what
   they NEED to see, so we can keep it clean and speedy.

Viewing 1 replies (of 1 total)

The topic ‘Loading Mobile/Desktop Headers Dynamically’ is closed to new replies.

## Tags

 * [client](https://wordpress.org/support/topic-tag/client/)
 * [detect](https://wordpress.org/support/topic-tag/detect/)
 * [development](https://wordpress.org/support/topic-tag/development/)
 * [header](https://wordpress.org/support/topic-tag/header/)
 * [mobile](https://wordpress.org/support/topic-tag/mobile/)

 * In: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
 * 1 reply
 * 1 participant
 * Last reply from: [CK Hicks](https://wordpress.org/support/users/ckhicks/)
 * Last activity: [15 years, 1 month ago](https://wordpress.org/support/topic/loading-mobiledesktop-headers-dynamically/#post-2027915)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
