Is there a way of using php rather than css to hide site title and description?

Hi

The issue in terms of appearance is that the site title and strapline are in the logo image - therefore the site title etc appearing to the right of the logo is counter-productive.

At the moment, I have this css to hide:

.home.page .site-title,
    .home.page .site-description {
         display: none;
    }

.site-title,
    .site-description {
      display: none;
    }

Is there a way of editing the php so that this is not necessary?

I am worried about hiding in relation to Google.

Any and all advice welcome!

Thanks,

Oliver

Hello Oliver,

Try removing these lines of code:

    <div class="media-body">
    	<?php
    	$description = get_bloginfo( 'description', 'display' );
    	if ( $description || is_customize_preview() ) : ?>
    		<p class="site-description site-slogan"><?php echo $description; /* WPCS: xss ok. */ ?></p>
    	<?php
    	endif;
    	if ( is_front_page() && is_home() ) : ?>
    		<h1 class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></h1>
    	<?php else : ?>
    		<p class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></p>
    	<?php
    	endif;
    	?>
    </div>

in this file wp-content/themes/greatmag/inc/functions/functions-header.php

Let me know how it goes.

Regards,
Kharis
aThemes Support

Perfect!

Thanks!

Oliver

1 Like

You’re welcome, Oliver!

Please let us know in a new topic if you have any further questions, or if we can provide you with any other assistance.

Regards,
Kharis
aThemes Support