WordPress.org

Forums

Tiny Forge
[resolved] Question about .site background-color and functions.php (17 posts)

  1. leejosepho
    Member
    Posted 1 year ago #

    I have added this color modification in style.css for my re-named Tiny Forge Child Theme:

    .site {
    	background-color: #f9f5db; /* light grayish yellow */
    }

    That works fine as long as I do not have any functions.php file in the folder for my Child Theme, but then when I add the tinyforgechild functions.php, that color no longer displays in my footer widget areas and I cannot figure out what to change where in the tinyforgechild footer.php file. I am assuming I need to change "tinyforgechild" to match the name for my own Child Theme, but my efforts at trying that so far have only resulted in blank screens.

    http://www.nnysandbox.net/

    Can you point me in a right direction here?

    Many thanks.

  2. leejosepho
    Member
    Posted 1 year ago #

    PS: I do not think this matters, but I might have previously had the default tinyforgechild Child Theme activated. But since I cannot find anything related to it in the database, it looks like I just need to get my own footer.php to match the name of my own Child Theme.

  3. Tomas Mackevicius
    Member
    Theme Author

    Posted 1 year ago #

    I didn't have time to investigate it yet, but just a thought...

    If you were using child theme without functions.php, that means you had to plug in the style.css of the main theme with @import.

    When you add functions.php it plugs in the main style sheet again. Usually main style.css should go before child theme's style.css in order for the child to override the rules, but perhaps the order of loading changed?

  4. leejosepho
    Member
    Posted 1 year ago #

    When I had no functions.php, the style modifications in my Child Theme that is not named "tinyforgechild" still worked...but then adding the tinyforgechild functions.php brought in the tinyforge parent sheet and overwrote my Child Theme since functions.php was looking for "tinyforgechild" rather than my differently-named sheet. So, it seems the child sheet is getting things started only to have to be called again later after functions.php has called the parent sheet.

  5. Tomas Mackevicius
    Member
    Theme Author

    Posted 1 year ago #

    Original style.css from the child theme have @import commented out. So normally, if you use a provided child theme example, without functions.php you would not get styles from the parent theme, which is required.

    Unless WP now finds parent css automatically, but I highly doubt that is the case.

  6. leejosepho
    Member
    Posted 1 year ago #

    The style.css of the active theme is processed, and then anything after that is optional. With Twenty Twelve, I have been using a full sheet with a template line and no @import line. I could do the same here and just delete the lines in functions.php that are calling for any sheet, but then I would still be left with the challenge of finding and rewriting anything else either there or anywhere else that is expecting to be able to find "tinyforgechild". Not complaining, of course, just trying to discover how difficult that would actually be since I really only know how to do little more than to cut-and-paste!

  7. Tomas Mackevicius
    Member
    Theme Author

    Posted 1 year ago #

    You see, that's why you have to start with the provided child theme's style.css, because it gives you an empty structure and makes it easy to port things one by one. By not importing parent styles you lose all updates related to the style, when they will come.

    Another thing with having only few things in your child style file, makes it easy to understand what you do and how it works ;)

    But if you want to start, I better send you an updated child theme's style.css.

  8. leejosepho
    Member
    Posted 1 year ago #

    If I continue with Tiny Forge, it will be by using a full sheet in my Child Theme and replacing the string "tinyforgechild" wherever it might exist..and I am assuming it does not exist within Tiny Forge, the parent. You are certainly under no obligation here, but my question is about whether "tinyforgechild" is present anywhere other than within its own functions.php...and either way, Tiny Forge is a nice theme and I will have learned from the overall experience of at least beginning to use it.

  9. Tomas Mackevicius
    Member
    Theme Author

    Posted 1 year ago #

    "tinyforgechild-style" is just the name, so you would now what style it is, the real info gets pulled by this:

    get_stylesheet_uri()

    This native WP function points directly to style.css in the child theme's folder

    Same for parent sheet. What matters is:

    get_template_directory_uri() . '/style.css'

  10. leejosepho
    Member
    Posted 1 year ago #

    I thank you for your patience with me as I learn here! At the moment (and only temporarily), I am not using functions.php in my renamed Tiny Forge Child Theme and everything from my full style sheet in my Child Theme is working just as it should. So, and with my previous beginnings considered, that means the default Child Theme for Tiny Forge does cause that sheet to be processed a second time after functions.php has called for the parent sheet (which had not happened in my case apparently because the child sheet was in a folder with a different name and could not be found).

    As to the color problem I had mentioned at the beginning of this thread, that is/was simply a matter of Tiny Forge having a separate color entry for the footer area by default where Twenty Twelve does not.

    Many thanks!

  11. Tomas Mackevicius
    Member
    Theme Author

    Posted 1 year ago #

    Learning is good, but it is always better to start right from the beginning, because unlearn bad habits is even harder ;)

    So take that empty template and start having programming fun the right way :)))

  12. wwnet
    Member
    Posted 1 year ago #

    I not have quite understood-making the affiliated subject without fall?
    I already question, what change the background of the messages blog, but me nobody does not answer. What line is in css to have charge of background blogs record?
    And what do the messages in the manner of announcement?

  13. Tomas Mackevicius
    Member
    Theme Author

    Posted 1 year ago #

    Is this a google translate text? It's very hard to understand... if you are from Ukraine, can you just type it in Russian - I understand Russian.

    Also, is it related to Tiny Forge theme?

  14. wwnet
    Member
    Posted 1 year ago #

    Да я уже тут написал, потому что по 2012 не отвечают, а вопросы у меня те же. Подскажите пожайлуста, в какой строке css сменить белый фон? Вот мой блог http://blog.tef.co.ua/

  15. Tomas Mackevicius
    Member
    Theme Author

    Posted 1 year ago #

    /* Page structure */
    .site {
    	padding: 0 24px;
    	padding: 0 1.714285714rem;
    	background-color: #fff;
    }

    I suggest you to use FireFox Inspector to see what styles are affecting the elements:

    https://www.youtube.com/watch?v=VcuQ2Bn5bTA

    You can activate it with: CTRL+SHIFT+I

    and select with the mouse element you need.

  16. wwnet
    Member
    Posted 1 year ago #

    Браво! Спасибо большое! Вы-гуру!!! Я поучусь так определять классы, а то я уже столько просмотрел в файле и не мог найти.
    Спасибо!

  17. leejosepho
    Member
    Posted 1 year ago #

    I made these to add to the Tiny Forge Child Theme folder, if you wish:

    https://dl.dropboxusercontent.com/u/5489953/screenshot.png
    https://dl.dropboxusercontent.com/u/5489953/wp-tilted.zip

Topic Closed

This topic has been closed to new replies.

About this Theme

About this Topic

Tags

No tags yet.