Advertisement
nerru86

51Degrees non-plugin device detection for wordpress.

Aug 20th, 2014
271
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.87 KB | None | 0 0
  1. <?php
  2. global $_51d;
  3. require_once 'wp-content/plugins/51degreesmobi/51Degrees/51Degrees.php';
  4. require_once 'wp-content/plugins/51degreesmobi/51Degrees/51Degrees_usage.php';
  5. /**
  6.  * The Header template for our theme
  7.  *
  8.  * Displays all of the <head> section and everything up till <div id="main">
  9.  *
  10.  * @package WordPress
  11.  * @subpackage Twenty_Twelve
  12.  * @since Twenty Twelve 1.0
  13.  */
  14. ?><!DOCTYPE html>
  15. <!--[if IE 7]>
  16. <html class="ie ie7" <?php language_attributes(); ?>>
  17. <![endif]-->
  18. <!--[if IE 8]>
  19. <html class="ie ie8" <?php language_attributes(); ?>>
  20. <![endif]-->
  21. <!--[if !(IE 7) | !(IE 8)  ]><!-->
  22. <html <?php language_attributes(); ?>>
  23. <!--<![endif]-->
  24. <head>
  25.  
  26. <?php
  27. if(isset($_51d['JavascriptHardwareProfile']))
  28. {
  29.     echo "Setting FODPO <HR>";
  30.     echo "<script src=\"wp-content/plugins/51degreesmobi/51Degrees/51Degrees.core.js.php\" > </script>";
  31.     echo "<script>new FODPO();</script>";
  32. }
  33. ?>
  34.  
  35. <meta charset="<?php bloginfo( 'charset' ); ?>" />
  36. <meta name="viewport" content="width=device-width" />
  37. <title><?php wp_title( '|', true, 'right' ); ?></title>
  38. <link rel="profile" href="http://gmpg.org/xfn/11" />
  39. <link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" />
  40. <?php // Loads HTML5 JavaScript file to add support for HTML5 elements in older IE versions. ?>
  41. <!--[if lt IE 9]>
  42. <script src="<?php echo get_template_directory_uri(); ?>/js/html5.js" type="text/javascript"></script>
  43. <![endif]-->
  44. <?php wp_head(); ?>
  45.  
  46. </head>
  47. <?php
  48.  
  49. ?>
  50.  
  51. <body <?php body_class(); ?>>
  52. <pre>
  53. <?php
  54. echo "Hardware Vendor: " . $_51d['HardwareVendor'] . "<br>";
  55. echo "Hardware Model: ". $_51d['HardwareModel'] . "<br>";
  56. echo "Hardware Name: " . $_51d['HardwareName'][0] . "<br>";
  57. //var_dump($_51d);
  58. ?>
  59. </pre>
  60. <HR>
  61. <div id="page" class="hfeed site">
  62.     <header id="masthead" class="site-header" role="banner">
  63.         <hgroup>
  64.             <h1 class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></h1>
  65.             <h2 class="site-description"><?php bloginfo( 'description' ); ?></h2>
  66.         </hgroup>
  67.  
  68.         <nav id="site-navigation" class="main-navigation" role="navigation">
  69.             <h3 class="menu-toggle"><?php _e( 'Menu', 'twentytwelve' ); ?></h3>
  70.             <a class="assistive-text" href="#content" title="<?php esc_attr_e( 'Skip to content', 'twentytwelve' ); ?>"><?php _e( 'Skip to content', 'twentytwelve' ); ?></a>
  71.             <?php wp_nav_menu( array( 'theme_location' => 'primary', 'menu_class' => 'nav-menu' ) ); ?>
  72.         </nav><!-- #site-navigation -->
  73.  
  74.         <?php if ( get_header_image() ) : ?>
  75.         <a href="<?php echo esc_url( home_url( '/' ) ); ?>"><img src="<?php header_image(); ?>" class="header-image" width="<?php echo get_custom_header()->width; ?>" height="<?php echo get_custom_header()->height; ?>" alt="" /></a>
  76.         <?php endif; ?>
  77.     </header><!-- #masthead -->
  78.  
  79.     <div id="main" class="wrapper">
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement