• Resolved scalpmonkey

    (@scalpmonkey)


    Hi, how do we remove link from hero title and leave it just as text?
    tnx,
    S@

    The page I need help with: [log in to see the link]

Viewing 6 replies - 1 through 6 (of 6 total)
  • Hi, @scalpmonkey

    Add the following code to Appearance -> Customize -> Additional CSS:

    .site-title a {
        pointer-events: none;
    }
    Thread Starter scalpmonkey

    (@scalpmonkey)

    Hi Ina,
    thanks for the tip but this way I will loose the text.
    I might have not explained batter.
    I dont want the text to be clickable but I want to keep the text. If I dont put link URL in the Customize dashboard it still got the rollover with the mouse and clicking on it reloads the page.

    Thanks,
    S@

    @scalpmonkey the provided code doesn’t hide the text. It simply deactivates the link under the text and makes it unclickable.

    Thread Starter scalpmonkey

    (@scalpmonkey)

    Ah great! Thanks!
    S@

    I was suffering from the same issue, but pointer-events: none simply disables interaction on your page’s largest title, which is horrible for many reasons (SEO, accessibility, etc). It doesn’t “unlink” it.

    I managed to solve this by going to Appearance > Theme File Editor and locating the file template-parts/header/site-branding.php.

    Once you’re there, replace lines 32-36…

    
    <?php if (is_front_page()): ?>
    				<h1 class="site-title"><a href="<?php echo esc_url($button_url); ?>" target="<?php echo esc_attr($button_target); ?>"><?php echo esc_html($site_title); ?></a></h1>
    			<?php
    else: ?>
    				<p class="site-title"><a href="<?php echo esc_url($button_url); ?>" target="<?php echo esc_attr($button_target); ?>"><?php echo esc_html($site_title); ?></a></p>
    			<?php
    endif; ?>
    
    
    with:
    

    <?php if (is_front_page()): ?>
    <h1 class="site-title"><?php echo esc_html($site_title); ?></h1>
    <?php
    else: ?>
    <p class="site-title"><?php echo esc_html($site_title); ?></p>
    <?php
    endif; ?>`

    The only difference is that the <a> (link) HTML tags have been removed, which actually removes the link from your header.

    @bayareascriptorium make sure to also apply these changes in a Child Theme. If you make the changes directly in the theme files, they will be rewritten in the next theme update.
    https://www.wpzoom.com/docs/create-child-theme-for-wpzoom-themes/

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘How to remove link from hero title?’ is closed to new replies.