• Hi,

    I’m trying to make the site-title of my page not a link (text only).
    First I searched in the header.php but couldn’t find the right section. Then I discovered this part in the functions.php:

    /**
     * Site branding
     */
    if ( ! function_exists( 'oria_branding' ) ) :
    function oria_branding() {
    	if ( get_theme_mod('site_logo') && get_theme_mod('logo_style', 'hide-title') == 'hide-title' ) :
    		echo '<a href="' . esc_url( home_url( '/' ) ) . '" title="' . esc_attr(get_bloginfo('name')) . '"><img class="site-logo" src="' . esc_url(get_theme_mod('site_logo')) . '" alt="' . esc_attr(get_bloginfo('name')) . '" /></a>';
    	elseif ( get_theme_mod('logo_style', 'hide-title') == 'show-title' ) : //Show logo, site-title, site-description
    		echo '<a href="' . esc_url( home_url( '/' ) ) . '" title="' . esc_attr(get_bloginfo('name')) . '"><img class="site-logo show-title" src="' . esc_url(get_theme_mod('site_logo')) . '" alt="' . esc_attr(get_bloginfo('name')) . '" /></a>';
    		echo '<h1 class="site-title"><a href="' . esc_url(home_url( '/' )) . '" rel="home">' . esc_html(get_bloginfo('name')) . '</a></h1>';
    		echo '<h2 class="site-description">' . esc_html(get_bloginfo( 'description' )) . '</h2>';
    	else : //Show only site title and description
    		echo '<h1 class="site-title"><a href="' . esc_url( home_url( '/' ) ) . '" rel="home">' . esc_html(get_bloginfo('name')) . '</a></h1>';
    		echo '<h2 class="site-description">' . esc_html(get_bloginfo( 'description' )) . '</h2>';
    	endif;
    }
    endif;

    I think this is the right section, but I’m not quite sure how/where to edit it correctly to disable the link.

    So any help would be much appreciated!

    PS: Yes, I’m using a child theme.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Vamsi

    (@mannemvamsi)

    In that case you have to remove ‘a’ tags

    function oria_branding() {
    	if ( get_theme_mod('site_logo') && get_theme_mod('logo_style', 'hide-title') == 'hide-title' ) :
    		echo '<img class="site-logo" src="' . esc_url(get_theme_mod('site_logo')) . '" alt="' . esc_attr(get_bloginfo('name')) . '" />';
    	elseif ( get_theme_mod('logo_style', 'hide-title') == 'show-title' ) : //Show logo, site-title, site-description
    		echo '<img class="site-logo show-title" src="' . esc_url(get_theme_mod('site_logo')) . '" alt="' . esc_attr(get_bloginfo('name')) . '" />';
    		echo '<h1 class="site-title">' . esc_html(get_bloginfo('name')) . '</h1>';
    		echo '<h2 class="site-description">' . esc_html(get_bloginfo( 'description' )) . '</h2>';
    	else : //Show only site title and description
    		echo '<h1 class="site-title">' . esc_html(get_bloginfo('name')) . '</h1>';
    		echo '<h2 class="site-description">' . esc_html(get_bloginfo( 'description' )) . '</h2>';
    	endif;
    }
    Thread Starter Mr Ben X

    (@mr-ben-x)

    Vamsi,

    Thank you very much!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Remove the link in the site title’ is closed to new replies.