- This topic has 6 replies, 3 voices, and was last updated 9 years, 3 months ago by Tom.
-
AuthorPosts
-
June 8, 2015 at 8:00 am #113148Andrew Thompson
Hello GP Community!
I’m sorry if this question is completely noob but I am fairly new at development.
I’m trying to re-size my main navigation bar to make the width slightly smaller than the standard area. I’ve already downloaded the blank child theme, but I’ll admit, I’ve never added custom css to style.css before so if there’s anything else I might need to do please let me know.
June 8, 2015 at 9:09 am #113168Roberto EnriqueI think you should try the spacing add-on.
If you share a link to your website or a screenshot/mockup explaining exactly what you want to accomplish hopefully we can help you with some custom css.
June 8, 2015 at 9:17 am #113172Andrew ThompsonHello Roberto!
Thank you for the reply!
Here is a moqup of what we would like the end result to look like: https://moqups.com/djamilak/k4qx13IU
Here is the current site: http://www.lyolife.com
June 8, 2015 at 9:30 am #113183Roberto Enriquewow, that stuff to the right of your menu feels like heavy mods 🙂
…but, whatever…
Using this:
.inside-navigation.grid-container.grid-parent { background: #ffffff none repeat scroll 0 0; margin-left: 40px; margin-right: 40px; }
and setting #site-navigation to the desired background color should do the trick
nav#site-navigation { background: #00376d none repeat scroll 0 0; }
You’ll have to play a bit with media-queries so your menu behave nice on mobile view but that’s not too difficult.
June 8, 2015 at 9:41 am #113185TomLead DeveloperLead DeveloperThat stuff to the right of the nav will definitely take some customization – you may want to look at the
generate_inside_navigation
hook for adding your HTML in there.I would personally set the navigation background to your dark blue, and then set the menu item background to white – then the white will expand to the right as far as your menu items take it, and you can float your HTML to the right using the hook above.
June 8, 2015 at 12:44 pm #113255Andrew ThompsonThanks guys!
Just one thing though.In my GP Hooks I don’t have access to generate_inside_navigation…
Do you know possibly why I can’t see it?June 8, 2015 at 12:47 pm #113257TomLead DeveloperLead DeveloperIt’s not in GP Hooks (yet) – I think I should probably add it as more and more people are wanting to use it.
For now, you can use a simple function:
add_action( 'generate_inside_navigation','generate_insert_into_navigation' ); function generate insert_into_navigation() { ?> Put your HTML or whatever in here <?php }
Adding PHP: http://generatepress.com/knowledgebase/adding-php-functions/
-
AuthorPosts
- You must be logged in to reply to this topic.