ptm666
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: change Element with custom field – not workingThis works
<?php header(‘Content-type: text/css’); $newBG = “darkviolet”; ?> #Box2 { background: <?php echo $newBG ?> !important; } #Box2 { background:red }This is not working:
<?php header(‘Content-type: text/css’); $newBG = get_post_meta($post->ID, ‘custombg’, true); ?> #Box2 { background: <?php echo $newBG ?> !important; } #Box2 { background:red }Is there any chance to bring this dss into the loop that it knows the code? Or can I set this proberty somewhere else:
$newBG = get_post_meta($post->ID, ‘custombg’, true);
(customfield-key: custombg / value: yellow)Forum: Fixing WordPress
In reply to: change Element with custom field – not workingIts the last, so i dont need that “;” in this case, It´s just a test for me, so I know when another function is calling that background, because I set the first one on !important.
The problem i have, is, i guess so, that i want to have informations outside the loop right?
There are the normal php files of wordpress and plugins and so on. I changed style.css to style.css.php so that i can use dynamic code in css. It works somehow I just cant talk to the loop or the element. Its not working. When i bring simple wp calls like “the_meta();” it is not reading it. How can I solve this?
Thx for your help!