godaddy-wordpress / primer-child-velux

Velux is a Primer child theme with a clean, professional, and upscale design.
13 stars 7 forks source link

Does adding logo suppress site-title and tagline? #58

Closed lukefivedev closed 6 years ago

lukefivedev commented 6 years ago

Does adding a logo suppress display of the site-title and tagline text (on the home page)? This is the behavior we have seen on a site almost completed for a client.

lukefivedev commented 6 years ago

I have confirmed this. I removed the logo via Appearance and now the site-title and tagline are visible again. Really not what we hoped for.

EvanHerman commented 6 years ago

Hi @lukefivedev ,

That's correct. When a logo is added to the site via the customizer the site title and tagline are removed.

lukefivedev commented 6 years ago

Any work-arounds? A hack?

EvanHerman commented 6 years ago

Hi @lukefivedev

It does look like the site title and tag line are not displaying because of the following line contained inside of Velux: https://github.com/godaddy/wp-velux-theme/blob/develop/functions.php#L59-L76

What I can recommend is simply removing the actions with remove_action inside of a custom MU plugin. If you need help setting up an MU plugin, you may want to review the documentation we have setup https://godaddy.github.io/wp-primer-theme/tutorials-and-examples/tutorials/mu-plugin.html.

When you've got the MU plugin setup, you can remove the actions by adding the following two lines to the plugin:

remove_filter( 'primer_the_site_title',       'velux_the_site_title' );
remove_filter( 'primer_the_site_description', 'velux_the_site_title' );

Once added you can save the file, and your site title and tag line should be visible alongside the custom logo. However, you may need to tweak the CSS to ensure that the site title and tagline fit into the theme, as it is intended to be hidden.

Let us know if that helps.

Evan

lukefivedev commented 6 years ago

Evan, I looked over the links and that is pretty clear. I have built one small custom plugin so far, but what you've shown me here is a simple adjustment to site behavior. Thanks for the detailed reply. (I will come back here to close when the work is done.)

lukefivedev commented 6 years ago

Almost. It installed nicely. Adding a logo still causes suppression of several items. I compared your Github functions.php with mine and only one line varies. Yours says define( 'PRIMER_CHILD_VERSION', '1.1.1' ); whereas mine says define( 'PRIMER_CHILD_VERSION', '1.1.0' );

Also below is my full mu-plugin... <?php /** * Plugin Name: Show All Header * Description: Velux theme -shows all text and image objects in header * Author: Keith Purtell * Version: 1.0.0 */

// Turn off Velux setting that suppresses site-title and tag line // in the presence of a logo image. remove_filter( 'primer_the_site_title', 'velux_the_site_title' ); remove_filter( 'primer_the_site_description', 'velux_the_site_title' );

EvanHerman commented 6 years ago

It sounds like you still have Velux version 1.1.0 installed. Can you try updating to 1.1.1? You can download v1.1.1 from the link found in the v1.1.1 release: https://github.com/godaddy/wp-velux-theme/releases/tag/v1.1.1

lukefivedev commented 6 years ago

Successfully installed Velux 1.1.1. Adding in a logo image continues to suppress other elements. Thoughts?

EvanHerman commented 6 years ago

@lukefivedev,

Sorry about that. I believe that the MU plugin is loading before the theme files, so we're trying to remove filters that don't yet exist.

Try wrapping the remove_filter( ... lines inside of a function, and hook that into the after_setup_theme so the code executes after the theme is setup.

// Turn off Velux setting that suppresses site-title and tag line
// in the presence of a logo image.
function velux_show_site_title_tagline() {

    remove_filter( 'primer_the_site_title',       'velux_the_site_title' );
    remove_filter( 'primer_the_site_description', 'velux_the_site_title' );

}
add_action( 'after_setup_theme', 'velux_show_site_title_tagline' );
lukefivedev commented 6 years ago

That was the final step! Thank you Evan for the fix.

EvanHerman commented 6 years ago

No problem at all - Hope you have a great rest of your day!