salcode / bootstrap-genesis

WordPress Genesis Child Theme setup to use Bootstrap, Sass, and Grunt
MIT License
184 stars 63 forks source link

Breakout Primary .navbar-brand into an action and hooked function #95

Closed salcode closed 9 years ago

salcode commented 9 years ago

This would allow unhooking the default link with the Blog Name and allow replacing that with something else (e.g. a logo)

See #80

bryanwillis commented 9 years ago

Hey @salcode sorry I've been MIA for awhile. I'd actually added customizer support for logo option in place of the navbar-brand text. I'll upload when I get a chance today or tomorrow.

salcode commented 9 years ago

No worries about the radio silence, @bryanwillis. I hope all is well.

I'm very interested in seeing your code adding customizer support. The customizer is something I have very little experience with at this point.

Overall my perference for this theme is to keep the configuration in the code rather than the database. I really like when I can deploy a theme without then going in and making modifications via the admin. Despite this view, I think the customizer option sounds really cool.

I think the ideal would be adding a hook (or more likely a filter) to change the markup in the theme and then create a plugin that allows inserting an image there via the customizer. This would be kind of like the Bootstrap Genesis Fixed Nav plugin, which extends the theme.

Again, I'd love to see your customizer code and I'm interested in hearing your thoughts about the idea of putting that functionality in a plugin.

salcode commented 9 years ago

Why I'm Not Using an Action and a Hooked Function

While I like the idea of the action and hooked function, currently all the nav markup is generated via a filter on wp_nav_menu. Since this is within a filter, we need to return a string rather than output directly to the screen. Using an action lends itself to printing out directly on the screen*, thus I'm going to close this ticket and apply the filter mentioned in #80.

* I recognize that we could still use an action and wrap it in ob_start() and buffer the output but that seems over-engineered.