Child Theme Question

Are *all* php files supposed to be picked up by the child theme?

For instance, if I want to make a change to ....

/library/functions/custom-functions.php

....and I copy that file to my child theme with the same directory structure

network-child/library/functions/custom-functions.php

Then I make changes to the file that resides within the child theme.

Shouldn't the change I made to that file in my child theme show up on my site? I'm doing this and not seeing the changes. If I make them in the parent theme they show up fine.

I'm really sorry if this is a dumb question but I'm confused about the reason why this isn't getting picked up.

Thank you for any assistance that can be offered. I'm pulling my hair out here.

~ Corey

  • DavidM
    • DEV MAN’s Mascot

    Hi Corey,

    Good question! Network's functions.php file loads in the custom-functions.php with a specific url as follows:
    require( dirname( __FILE__ ) . '/library/functions/custom-functions.php' );

    Child themes don't override the parent's functions.php, but can add to it as mentioned here:
    http://codex.wordpress.org/Child_Themes#Using_functions.php

    What I imagine you could do is create a copy of the functions from that file that you'd like to use, rename them and add them to the child theme's functions.php file, and in your child theme files, reference those functions instead.

    It's a bit extensive, but given the the theme's complex structure, I don't really see another way.

    Hope this helps!

    -David

  • NetPotion
    • The Incredible Code Injector

    That sounds like a pretty big pain to simply remove text from the buttons - which is what I'm hoping to do.

    I can't seem to alter the positioning of button text with CSS so I thought I would just embed it in the image I'm using instead. I guess I'll just have to make a note of what I did so that I can go back and fix things back up whenever the theme updates. I don't really know how to do what you're describing here & I'm not sure it would be worth it for such a simple task.

    Thanks for the response David. I'm glad to know it wasn't something I was doing wrong anyway. =)

    ~ Corey

  • NetPotion
    • The Incredible Code Injector

    I've tried everything I can think of and it keeps taking the button with it.

    I'm trying to do a CSS rollover with the registration button. Whenever I adjust the positioning of the text, it either drags the button along with it - or shows part of the second rollover image when the text repositions.

    I can't seem to get the text to position itself independently from the background image regardless which style I alter. I got so frustrated that I tracked the text down in the functions code, but even adding styling there doesn't work. That's why I was trying to remove the text completely and just go with an image with text embedded in it. Of course I would prefer not to go this route if at all possible.

    ~ Corey

  • NetPotion
    • The Incredible Code Injector

    Ugh, I'm able to move the text on the *other* buttons and make them show up right - but only in Firefox. It doesn't render the same on different browsers.

    I still can't move the text on the registration button independently of the button itself either.

    If anyone has any advice on how to accomplish these feats I would appreciate it.

  • Mason
    • DEV MAN’s Sidekick

    Hiya netpotion,

    The rollover on the original theme buttons is created using CSS rather than moving the background image. The button images are also meant to be a specific size - the CSS isn't prepared to handle a different sized image and allow for moving of the text.

    Also, the method of using the !important statements in the child theme should really be avoided at all costs. It makes it incredibly difficult to see what properties are actually taking affect and really isn't required if the styles are placed properly.

    So, what can you do if you want to keep that particular button? Well, you'll need to wrap the text of that particular button with a <span> tag which will then allow for independent styling of the text.

    The only way to do this is using the method David described above of creating your own custom function (a modified copy of the signup_button function in custom_functions.php) and adding it to your child theme's function file. Give it a unique name and then reference it from your child theme's branding-header.php.

    Thanks!

  • NetPotion
    • The Incredible Code Injector

    Thanks Mason. I was actually going to ask about why I'm always having to use !important statements to get things modified.

    Just a sidenote - I tried using a span around the text in that function. It didn't work either.

    I'm either going to wind up dumping the child theme & modify the main theme, or find a completely different theme I think. Most likely the latter. I can't seem to accomplish much of anything I want to do with this one.

    Thanks for all your help this weekend Mason. You're a kind soul to have such patience. =)

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.