• Resolved Mr Ben X

    (@mr-ben-x)


    Hi,
    I asked a very similar question back in October, but I hat to stop working on my home page quite abruptly and after all this month I have no idea what I was going to do back then.
    I tried to follow the advice in the old thread but it just did not work.

    So I have to ask again:
    How can I remove the link in the site title (I want it text only) using a child theme?

    Any help would be much appreciated!

Viewing 4 replies - 1 through 4 (of 4 total)
  • in functions.php of the child theme, create a new function:

    /* Site branding
     */
    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;
    }

    (not tested for typing errors)

    Thread Starter Mr Ben X

    (@mr-ben-x)

    Thanks for your help Michael. But unfortunately it does not work.

    I placed the new segment into the child’s functions.php and received immediately the following error (using live preview):

    Parse error: syntax error, unexpected ‘name’ (T_STRING), expecting ‘,’ or ‘;’ in /homepages/39/d158355682/htdocs/wp-content/themes/oria-child/functions.php on line 18

    I’m not quite sure how to fix it, sorry.

    there was indeed a typing mistake in the code;

    try this:

    /* Site branding
     */
    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;
    }

    as this chnages the html of the site title, you might need to adjust the CSS as well;

    .site-title
    {
      color: #ffffff;
    }
    Thread Starter Mr Ben X

    (@mr-ben-x)

    It Worked! Thank you very much!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘How to remove the link in the site title using a child theme?’ is closed to new replies.