Skip to content
This repository has been archived by the owner on Sep 16, 2019. It is now read-only.

child theme function override for navigation.php #88

Merged
merged 1 commit into from
Aug 18, 2014

Conversation

fourhexagons
Copy link
Contributor

Wrap navigation.php functions in if ( ! function_exists( ' ' ) ) {} to provide override support for child themes.

Wrap navigation.php functions in ```if ( ! function_exists( ' ' ) ) {}``` to provide override support for child themes.
@fourhexagons
Copy link
Contributor Author

I know that you don't particularly recommend or practice using FoundationPress with the WP child-theme model, but I thought I'd experiment with it today since there seem to be some others who are interested in it.

I discovered this because my add_menu_class function in navigation.php has an extra class (class= "button radius") and so when using a child theme, the parent theme would either error when the functions shared the same name, or if I named my function differently, it would remove the class leaving just "button".

The solution was to wrap all parent theme functions in these if statements thus allowing a child theme to provide its own theme function overrides as per http://codex.wordpress.org/Child_Themes.

If this child-theme support is something you're interested in, I'd be happy to attend to the other /library files.

@olefredrik
Copy link
Owner

My initial thought was that FoundationPress should act as a parent theme and a starting block for the development of new projects. Foundation can always be updated with foundation update anyway. But, as you say, there are people who prefer using child themes instead. So this looks good. Thank you for your contribution :)

olefredrik added a commit that referenced this pull request Aug 18, 2014
child theme function override for navigation.php
@olefredrik olefredrik merged commit 38405e2 into olefredrik:master Aug 18, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants