Title: Dynamic variable for using in php conditions &#8211; dynamic content
Last modified: August 22, 2016

---

# Dynamic variable for using in php conditions – dynamic content

 *  [faidoc](https://wordpress.org/support/users/faidoc/)
 * (@faidoc)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/dynamic-variable-for-using-in-php-conditions-dynamic-content/)
 * I have to fix a website which has a method to detect if the user is on mobile
   or desktop and according to that value some things happend in the theme files,
   like adding or not a css file or showing a video or not.
 * The site fails when navigating on desktop, sometimes the mobile version loads
   instead of desktop.
 * I imagine this is because in the theme files there’re some things like:
 *     ```
       <?php if($movil) : ?>
       <link rel="stylesheet" href="<?php bloginfo( 'template_url' ); ?>/css/responsive.css?v=3" type="text/css" media="screen" />
       ```
   
 * Is there a way to fix this? to allow that sections to be dynamic? I thought about
   creating a SC plugin to do something, but every time that conditions is made 
   would be a new plugin right?
 * Thanks
 * [https://wordpress.org/plugins/wp-super-cache/](https://wordpress.org/plugins/wp-super-cache/)

The topic ‘Dynamic variable for using in php conditions – dynamic content’ is closed
to new replies.

 * ![](https://ps.w.org/wp-super-cache/assets/icon-256x256.png?rev=3506220)
 * [WP Super Cache](https://wordpress.org/plugins/wp-super-cache/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-super-cache/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-super-cache/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-super-cache/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-super-cache/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-super-cache/reviews/)

## Tags

 * [php](https://wordpress.org/support/topic-tag/php/)
 * [super cache](https://wordpress.org/support/topic-tag/super-cache/)

 * 0 replies
 * 1 participant
 * Last reply from: [faidoc](https://wordpress.org/support/users/faidoc/)
 * Last activity: [11 years, 3 months ago](https://wordpress.org/support/topic/dynamic-variable-for-using-in-php-conditions-dynamic-content/)
 * Status: not resolved