Created
September 23, 2012 13:43
-
-
Save CodeNegar/3771059 to your computer and use it in GitHub Desktop.
php: wordpress generate dynamic style sheet file
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| require_once('../../../../wp-load.php'); | |
| header("Content-type: text/css"); | |
| $days_to_cache = 10; | |
| header('Expires: '.gmdate('D, d M Y H:i:s',time() + (60 * 60 * 24 * $days_to_cache)).' GMT'); | |
| $plugin_path = WP_PLUGIN_URL.'/'.str_replace(basename( __FILE__),"",plugin_basename(__FILE__)); // plugin folder ex: http://localhost/wordpress/wp-content/plugins/dynamic-style/ | |
| $some_option = get_option('blogname'); | |
| $some_data = 450; | |
| ?> | |
| .my_half_width_class { width: <?php echo $some_data; ?>px; } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment