Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   Header configuration & styling (http://forum.bytesforall.com/forumdisplay.php?f=15)
-   -   Styles dumped into Header.php transfer to stylesheet (http://forum.bytesforall.com/showthread.php?t=18237)

Newdust.com Aug 22, 2012 06:51 PM

Styles dumped into Header.php transfer to stylesheet
 
Hello BFA,

I really don't like the dynamic CSS aspect of the Atahualpa theme for one reason only: it adds 650+ lines of code to the header.php file. For those of you who don't know what I'm talking about, here's an example:

PHP Code:

/* This is pulled straight from the header.php file */

a:link, a:visited, a:active {
    color: #<?php echo $bfa_ata_link_color?>
    font-weight: <?php echo $bfa_ata_link_weight?>
    text-decoration: <?php echo $bfa_ata_link_default_decoration?>
}

The rules are pulled from whatever is typed into the "Body, Text & Links" menu within the Atahualpa Theme Options.

CSS needs to be kept separate from HTML and PHP files. It's the proper way to do it, and it makes for cleaner front-end code. There has to be a better way for the Atahualpa theme to do this so as not to clog up our PHP files with something that shouldn't be in a PHP file to begin with. I've tried pulling all of the CSS declarations out of header.php and keeping them in a style.php file (based on an article I read at css-tricks.com - click here to read ). This did not work however - the PHP was not properly executed, almost as if it were automatically commented out of the file.

And so I wonder: has anyone successfully separated the CSS from the Header.php file into it's own file?
The obvious solution would be to just ignore the Atahualpa Theme Options as a means of editing the CSS, and just dumping the generated CSS into the style.css file. That would defeat the purpose of the Atahualpa Theme editor, which I think is a great feature that needs to stay intact.

juggledad Aug 22, 2012 07:20 PM

There is no CSS in header.php - there is CSS in css.php which builds the css style sheet inline or as an external file, but no css in the header.php code. If you have actual css there you might want to load down a new version and do a file compare.

and what version of atahualpa are you using

if you don't like the dynamic nature of the CSS you could always save it external and then remove the code that creates it. There is an old post explaining how to do that.

of course if you change a setting it won't be reflected so you'll have to put the code back in to recreate the file and then pull the code back out.

Newdust.com Aug 22, 2012 09:26 PM

That must have been addressed in a later version. I'm on 3.2, which states that the "CSS is spread over two files: header.php and style.css . . . header.php contains the dynamic CSS."

In that case I'll either update find the old post you mentioned that details the removal of the dynamic CSS.

juggledad Aug 23, 2012 04:14 AM

3.2!!! Wow you really need to upgrade. The current version is 3.7.7


All times are GMT -6. The time now is 12:57 AM.

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