Archived topic
How to swap Logo and Title position?
15 replies · Started by Anonymous on June 2, 2016
Currently, I have:
Title
Slogan
Logo
but I'd like the logo to be on top of the rest.
Couldn't find the file handling this. How to do that?
Thanks!
Hi there,
You can use this function: https://gist.github.com/generatepress/4cfa628cec96088dcbf8dd8cf399b83e
Adding PHP: https://generatepress.com/knowledgebase/adding-php-functions/
Just re-arrange the functions in there :)
Hi, I'm looking for a similar result so I hope it's ok to use an existing thread (day 1 using GeneratePress and I've made more progress in a couple of hours than with the umpteen other themes I tried and couldn't customize to my satisfaction!)...
I'd like the logo to be between the title and the tagline:
Site title
Logo
Tagline
I would also like them all to be aligned to center - can that also be done in the same function?
Hi there,
My answer above should work for you too :)
For the alignment, go to Customize - Layout and you'll see header alignment and navigation alignment.
Hope this helps!
Thanks, got the alignment sorted. But I'm after the logo going in between the title and tagline. Can I separate them in the code?
Instead of:
// Site title and tagline
generate_construct_site_title();
// Site logo
generate_construct_logo();
I tried this, but it's definitely not right because it resulted in errors:
// Site title
generate_construct_site_title();
// Site logo
generate_construct_logo();
// Site tagline
generate_construct_tagline();
Thank you Tom!
Let me tell you, excellent theme and support. Keep up the great work!
Valerio
Thanks, Valerio! :)
Lisa - the title and tagline are wrapped into the same function. In order to separate them, you would need to build your header using custom code in GP Hooks.
You can disable the tagline in the Customizer, then add it to the "After Header Content" hook in GP Hooks like this:
<p class="site-description">Your tagline here</p>
Thanks - I'll have a look today. I've been meaning to take a look at GP Hooks!
Almost got it... it causes the logo to go slightly out of alignment (centered). Adding padding to the left causes it to be mis-aligned in mobile view.
In 'Layout' I have header alignment set to center, and at the moment I also have CSS code to add the padding which makes it appear centered on desktop view.
What am I missing?
Hard to tell without actually seeing the site.
Having a header widget in there can cause the center alignment to mess up.
You can apply CSS to desktop only with this media query:
@media (min-width: 769px) {
/* CSS in here for desktop only */
}
Ah, yes - it was a widget (social icons). I'm sure I can find somewhere else to put them instead of adding code.
Thanks for your help (so far - I think I might have a couple more questions but will see how I go).
Absolutely love GeneratePress and Add-ons!
Glad I could help :)
I need to do the same swap logo and title position but I really don"t get where to use this function
You can use this function: https://gist.github.com/generatepress/4cfa628cec96088dcbf8dd8cf399b83e
it's not cleae for me, in witch file ? I have tried in my child theme css, but it does'nt work, can you be more explicite for peopole like me ?
Thanks
Hi there,
It's a function/PHP so try this: https://docs.generatepress.com/article/adding-php/#use-a-child-theme
I have seen it and I have a child theme but my question is very simple, in witch file do i copy theses lignes
I understand that for professionals it is obvious, but having never done it I do not know or copy these lines
if ( ! function_exists( 'generate_header_items' ) ) :
/**
* Build the header
*
* Wrapping this into a function allows us to customize the order
*
* @since 1.2.9.7
*/
function generate_header_items()
{
// Header widget
generate_construct_header_widget();
// Site title and tagline
generate_construct_site_title();
// Site logo
generate_construct_logo();
}
endif;