| User | Post |
|
12:45 am January 25, 2012
| markz
| | |
| Member | posts 5 | |
|
|
Hi all:
I have a couple broad but elementary questions, and hope that some of you who have been around WordPress & Flex for a while can help me with.
Please understand that I'm really new to all of this, and I'm trying to get a handle on how all this works.
From what I've seen, when I add code to the Flex3 Custom CSS, it gets appended to the style .css file; if I remove it from the 'custom css' tab in Flex, it then gets removed from that .css file. Is it normal that that 'custom css' tab might get really extensive, as in huge? Is this process the best practice for adding or modifying styles?
Next, when I look at my .css file, all the Flex code is on one very long line (#10). That seems weird to me … I have a number of other plugins whose codes are broken out on multiple lines. Is this normal?
Finally, I still haven't got my li'l brain thoroughly wrapped around child themes. I have one set up, "Flex3-child" with the appropriate code in it: @import url("../flexibility3/style.css");
If I add any css to that child theme, it has no effect on my website … And I remember a while back Ryan had said not to be concerned with child themes. But what about updates: do they affect .css files, only other files (php? … and if so, what if any changes were made to those?)
In a nutshell, (and I admit it's a large nut), I'm confused on best practices for modifiying (and subsequently backing up) template & style files. Any general guidance would be greatly appreciated …
Thanks!
Markz
|
|
|
3:17 pm January 25, 2012
| Ryan
| | |
| Admin
| posts 1547 | |
|
|
The alternative to using the Custom CSS Code field is to just append your custom code to the end of the style.php file. That might be preferred if you're using a lot of custom code.
To get your CSS in a more readable format, turn off the CSS compression option right above the custom CSS code box.
I think you're the first person to try using a child theme with Flex 3. I couldn't even tell you what the end result would be because I've never tried it.
|
|
|
5:51 pm January 25, 2012
| markz
| | |
| Member | posts 5 | |
|
|
Hi Ryan:
Append to the end of style.PHP or style.CSS?
Appending to the end of .css seems to work, whereas to the end of .php does not.
thanks,
markz
|
|
|
6:03 pm January 25, 2012
| Ryan
| | |
| Admin
| posts 1547 | |
|
|
The end of style.php. But you need to go in and save your theme settings one time to write the new code into the style.css file.
|
|
|
6:28 pm January 25, 2012
| markz
| | |
| Member | posts 5 | |
|
|
Hi Ryan:
I'm finally getting it. One issue was that I created my child theme, added the style.css with "import url", and then I activated the child theme … apparently the child theme should just reside in the directory, but not be 'activated.'
So: I've activated Flex3 (parent), kept the child theme, and experimented with a snippet in various locations. The snippet works whether placed in the .css or the .php, in either the parent or child directory. And of course it works when placed in the Custom CSS box.
This is good news, because I had a problem a short while ago:
I made some changes to other php files, and I was worried they would be overwritten with an update. So I copied those templates into the child directory, and made minor changes. The changes worked, but other parts of my site broke. This was with the Child Theme Activated.
But now my guess is that with the Flex3 Parent activated, if I were to modify copied files like that again, all should work. And I'll assume I could take the snippets from the template and modify them in a child directory & it would work. Or create a template for a unique page type, etc. And they'd all safely reside outside of any directories subject to updates. And if I screw up any php, the original is still intact in the Parent Directory. (that alone will let me sleep at night).
I will experiment with this, and let you know how it shakes out.
Thanks for all your help, and for a great theme!
markz
|
|
|
11:09 pm January 25, 2012
| markz
| | |
| Member | posts 5 | |
|
|
Ok, after a bit of 'testing' … seems like I've got to rethink my previous results! Nothing I assumed above has proven true. (But I swear it was working as stated!)
Here's the science of note:
upon de-activating the child theme & re-activating the Parent Theme, most (but not all) widgets were removed …; most other data stayed intact, best as I can tell. (custom menus, etc).
So I put the site back together: I'm using the Parent theme, and have the child theme .css installed in a sibling directory. I also have a style.php file in the Child directory (but very abbreviated).
I have removed my test code snippet from everywhere: the site behaves accordingly (it works correctly, but doesn't have the snippet's styling).
Put the snippet in child style.css: does not have an affect on site. (but it should from what I've been told about child themes)
Put the snippet in child style.php (after removing it from style.css): no affect on site.
Put the snippet in Parent style.php, click 'save changes' in the custom css tab (even tho it's empty): affects site correctly. Snippet then appears in Parent style.css.
So I've learnd that Parent style.php affects the Parent style.css. Child Theme seems to have no affect on the site.
After all that, I'm back to just using Flex3 and the editor to make changes.
All this makes me ask, why have I heard so much about child themes and their importance. Is there something different about Flex that contradicts what I've heard, or am I just not getting the process correctly? Or does the structure of Flex obviate the need for child themes?
Last question (for today): If I wanted to make a change or an addition to a template, could I just create a class within the 'style.php', and not modify the 'page.php' ?
Sheesh, it's late; sorry for the long-winded-ness.
Have a good night;
markz
|
|
|
12:24 pm January 26, 2012
| Ryan
| | |
| Admin
| posts 1547 | |
|
|
The theme really does kind of eliminate any need for a child theme. The purpose of child themes is to extend a parent theme, maybe with a different look or something, but since you can create so many different looks within the theme itself, it's kind of pointless.
What you say 'class within the style.php' I'm assuming you mean CSS class. You can style anything within the site using additional CSS. So if you have a tool like Firebug you can just find the element ID or class, view the current CSS selectors that are affecting that element, then write your style accordingly to override it. You can either add the CSS to the end of the style.php file or add it within the Custom CSS Code box in the theme options.
|
|
|
10:39 am January 27, 2012
| markz
| | |
| Member | posts 5 | |
|
|
Hi Ryan:
Thanks for the replies. Yes, I meant a css class, and put the code in the style.php file. I've begun making modifications by adding the style to the end of the style.php file. I like that better than using the custom code box: it just seems cleaner to me.
And it seems that a child theme really is pointless …
Are there any files that I should be worried about being overwritten by theme updates? That was a topic elsewhere regarding an additional benefit to child themes. Given how little I know about how this works (but I'm learning), that doesn't seem like a valid point, unless these other people were modifying files that would be replaced after an update.
Thanks again for your help.
markz
|
|
|
12:17 pm January 27, 2012
| Ryan
| | |
| Admin
| posts 1547 | |
|
|
A theme update doesn't overwrite any files, because I always use a different folder for each update. So the next update might be flexibility31 or flexibility4. Either way it would set up a new folder.
|
|