MITLibraries / MITLibraries-child

A Wordpress child theme that descends from MITLibraries-parent
GNU General Public License v3.0
1 stars 1 forks source link

nav-child should be made site-agnostic #74

Open matt-bernhardt opened 8 years ago

matt-bernhardt commented 8 years ago

This section of nav-child should be changed: https://github.com/MITLibraries/MITLibraries-child/blob/master/inc/nav-child.php#L10-L12

Specifically, there shouldn't be code in a theme that references a specific site (or sites). Is it possible that this would be done via widgets, or via theme option?

(edit: updating link)

matt-bernhardt commented 8 years ago

For an alternative model, look at how Courtyard implements an ability to hide the site navigation in header.php via get_theme_mod and in inc\customizer via wp_customize.

PBruk commented 8 years ago

Am pretty sure we could remove that section you refer to above by checking if the child-nav exists? That said, it has bothered me that the postHead.php file contains calls for both the header-image, etc., - and - child-nav... should that be separated?

PBruk commented 8 years ago

p.s. I just tried using if ( has_nav_menu( 'child-nav' ) ) to check on sites like /docs, but that hasn't worked quite yet... will give it another shot.

matt-bernhardt commented 8 years ago

The implication of this, if I follow you, is that a menu would need to be created with the specific name child-nav - and upon this happening, it would automagically appear in the right place?

PBruk commented 8 years ago

That is what I was hoping to achieve, yes...

And then we could remove all that site-specific cruft up top...

2016-07-05 16:51 GMT-04:00 Matthew Bernhardt notifications@github.com:

The implication of this, if I follow you, is that a menu would need to be created with the specific name child-nav - and upon this happening, it would automagically appear in the right place?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/MITLibraries/MITLibraries-child/issues/74#issuecomment-230599200, or mute the thread https://github.com/notifications/unsubscribe/ABv1VSUPtCKg-oaoJMeJjEWNy1pblejVks5qSsPLgaJpZM4JDedw .

"The reason is never the reason."

- Some French Movie Director"Every portrait that is painted with feeling is a portrait of the artist, not the sitter." - Oscar Wilde