Archived topic
Replace link by a button
7 replies · Started by Boris on March 16, 2023
Hello,
I would like to replace a link by a button in the home page,
I give you an example in the secret area,
thanks
I forget to precise that it's in the home page only
Hi Boris,
Sorry but I cannot picture what you are trying to achieve in my head.
The Comment allumer la lumière d’un vélo électrique ? link is just the title of the post and an important <h2> for your site.
Are you able to show me an example of what you are trying to achieve?
Let me know :)
Hello leo,
Yes, I just want to obfuscate the link in the h2, it means that I want to remove the link and put in a button like this: <button onclick="location.href='http://www.example.fr/contact/'">CONTACTEZ NOUS</button> instead of href.
I would want this only for the home page and for all the h2
It's for Search Engine Optimization purpose.
Thanks in advance
I already have the css to remove the style of the button:
button{
text-transform: unset !important;
background: none;
color: inherit;
border: none;
padding: 0;
font: inherit;
cursor: pointer;
outline: inherit;
}
But how can i replace the href by the button for all h2 in the home page ?
It’s for Search Engine Optimization purpose.
Are you sure about that? It's a standard practice to have <h2> element as the post titles on the blog page - this is determined by WordPress itself and not the theme.
I've never heard that using a button is better for SEO.
Yes in fact the idea of the button was bad
Thanks I will open a new ticket after to be more clear
No problem :)