[wptest-www: 24/27] add support to use custom css in pages and posts with custom_css field



commit 438edde53c348c7e92cf8095232ca380287c8fc1
Author: Vinicius Depizzol <vdepizzol gmail com>
Date:   Mon Jan 30 21:15:51 2012 -0200

    add support to use custom css in pages and posts with custom_css field

 theme/header.php |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)
---
diff --git a/theme/header.php b/theme/header.php
index fa9f9fb..6d9a69d 100644
--- a/theme/header.php
+++ b/theme/header.php
@@ -31,6 +31,19 @@ if (function_exists('wppo_get_lang')) {
 
 <script type="text/javascript" src="<?php bloginfo('stylesheet_directory'); ?>/js/template.js"></script>
 <?php wp_head(); ?>
+
+<?php
+
+if (is_single()) {
+    $custom_css = get_post_meta($post->ID, 'custom_css', true);
+    if (!empty($custom_css)) {
+        echo '<style type="text/css">'."\n";
+        echo $custom_css."\n";
+        echo '</style>'."\n";
+    }
+}
+
+?>
 </head>
 
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]