Hi, @scalpmonkey
Add the following code to Appearance -> Customize -> Additional CSS:
.site-title a {
pointer-events: none;
}
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.
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/