Override defaults.php
-
Hi GP team,
I have created a child theme and trying to do a few things:
- Customize many default settings by copying over defaults.php into a subfolder called inc and editing the values. I have added the following line into my child theme’s functions.php:
$child_theme_dir = get_stylesheet_directory(); require $child_theme_dir . '/inc/defaults.php';
Making changes to the child theme’s defaults.php works as intended. However, I am worried whether these functions are being called twice when every page loads. Once from the parent and then again from the child. Do you know if that is the case? What do you recommend?
- Programmatically create a top bar. To do this, I am using,
add_action( 'generate_before_header','child_top_bar' );
and manually using top bar styles by wrapping my code inside<div class="top-bar grid-container"
. It seems fragile because the styling that I apply tobody > .grid-container
seems to override the.top-bar
styling. Is there a more robust way to create a top-bar programmatically? - A more worrisome question is that using hooks to create the top bar seems inefficient in creating static content. Is there a better option?
As always, thank you for your awesome help!
- Customize many default settings by copying over defaults.php into a subfolder called inc and editing the values. I have added the following line into my child theme’s functions.php:
Viewing 11 replies - 1 through 11 (of 11 total)
Viewing 11 replies - 1 through 11 (of 11 total)
- The topic ‘Override defaults.php’ is closed to new replies.