functions.php in child theme missing

  • garyc

    #6470

    hi guys

    I’m just tweaking my site. http://www.hackneytools.com, and I already have a child theme running. I’d like to adjust

    the width of the slider on my home page, so that the background images don’t get tiled. As I understand it from

    the forum, I can edit the functions.php in my child theme, but I only have a main stylesheet, (in bold) file listed,

    and an ‘rtl.styelsheet’, unlike the main theme folder, where I have loads of items.

    Can you tell me how I create a ‘functions’php’ file here please? Or, if I’ve done something wrong, how I refresh

    the child theme so I get the full list?

    thanks!

    Gary

    garyc

    #34474

    sorry guys, found a css fix on the forum, works fine.

    https://forum.graphene-theme.com/graphene-support/slider-custom-width#post-14442

    would be good to know about adding functions.php though. do I just add a <?p> opening

    and closing tag to any code I put in?

    thanks

    Gary

    garyc

    #34475

    Hmmm, actually, that css trick doesn’t work, it cuts the text off in the text box.

    <sigh>

    Back to original question I’m afraid. Thanks

    Mod

    Kenneth John Odle

    #34476

    A child theme functions file looks like this:

    <?php

    custom functions go here

    ?>

    Really, it’s that simple. The hard part is writing valid functions.

    Quote:
    do I just add a <?p> opening

    and closing tag to any code I put in?

    You only need the opening and closing php tags at the beginning and end of the file, so no. You can have nothing but pure functions in between.

    You can see an example of one of my functions.php files here: http://pastebin.com/ViaiFtxv

    Admin

    Syahir Hakim

    #34477

    Another tip: you don’t actually need the closing php tag. Reduces the risk of ‘header already sent error’ too.

    garyc

    #34478

    Ok, thanks guys. As long as I know I just need to type this into the open window I already

    have, that’s fine. I was just wondering whether I should be seeing a full list of options down

    the right hand side, like in the main theme window.

    Ok, thanks, marking as resolved.

    Mod

    Kenneth John Odle

    #34479

    That’s right—when you use a child theme, you will only see the child theme stylesheet and the child theme functions file (if you are using one) in the editor.

Viewing 7 posts - 1 through 7 (of 7 total)

  • You must be logged in to reply to this topic.