Wordpress Themes - WP Forum at BFA
There will be no more development for Atahualpa (or any other theme), and no support. Also no new registrations. I turned off the donation system. I may turn the forum to read only if it gets abused for spam. Unfortunately I have no time for the forum or the themes. Thanks a lot to the people who helped in all these years, especially Larry and of course: Paul. Take care and stay healthy -- Flynn, Atahualpa developer, Sep 2021

Wordpress Themes - WP Forum at BFA » WordPress Themes » Atahualpa 3 Wordpress theme »

Setting a reusable colour palette with php?


  #1  
Old Mar 2, 2010, 03:20 AM
camjackson
 
2 posts · Mar 2010
I've spent a bit of time creating a colour palette for myself to use across my site. The problem is that if I want to tweak one of the colours a little bit, I have to go through all the atahualpa options finding all the instances of that colour and changing it.
What I want to do is define some colours in one place, so I can just refer to them by name (like the presets red, blue etc) in multiple places.
I've done all the googling I can, and discovered that CSS doesn't have variables, but that it's possible to do with php. The php code that I found and modified looks like this:
PHP Code:
<?php
header
("Content-type: text/css");
$PalCol1 '#2660ff';
$PalCol2 '#6db0e8';
$PalCol3 '#daffff'
$PalCol4 '#ffffff';
?>
Assuming that's correct (which it might not be for all I know), how do I now refer to those colour names when setting colours in CSS? Also, where should that code go so that it will apply to my whole site? At the moment I've got it in the body style section, seeing as it says that that style will apply to everything that doesn't get its own style.

Alternatively, is there a completely different way of achieving this that I've missed?

Cheers,
Cam.
  #2  
Old Mar 6, 2010, 11:44 PM
camjackson
 
2 posts · Mar 2010
Bump.
Can anyone help with this?

Bookmarks

Tags
colors, custom, define, php



Similar Threads
Thread Thread Starter Forum Replies Last Post
Pls help me change this code<title><?php bloginfo('name'); ?><?php wp_title(); ?></ti tobywinn Header configuration & styling 1 Nov 18, 2011 12:51 PM
php in footer.php - links to just show up on homepage chris Atahualpa 3 Wordpress theme 6 May 9, 2010 01:50 PM
[SOLVED] Having trouble setting the font colour in 'Body, text &amp; links' thesis Atahualpa 3 Wordpress theme 7 Nov 2, 2009 07:30 AM
[SOLVED] Error in PHP Coding Using PHP Text Widget rnimchuk Sidebars & Widgets 2 Oct 28, 2009 01:26 PM
[SOLVED] messed up header.php and footer.php monochrome Header configuration & styling 0 Jun 20, 2009 03:16 PM


All times are GMT -6. The time now is 09:39 PM.


Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.