user

Shilpa

26 Feb 2022

Way to disable Block URLs for WordPress Posts

Wordpress

On my homepage of the WordPress website, a number of posts are listed already, but I don't want to let the user browse posts from the list.

How can I hide or disable or not let the user browse such blog posts?

Comments

Shilpa

26 Feb 2022

github

I was looking for the solution and I found a workaround. (I am curious to share what I did!)

 

While inspecting the HTML elements, I saw linkclass which was added in all of the posts by default. You can add below code snippet for that.

.linkclass {
	point-events: none; // it will work as disabled: true HTML Attribure
}

Using this, visitors can't browse or navigate to see more posts.

Rakshit

27 Feb 2022

Best Answer

best answer

You can achieve it by the below code,

[aria-current="page"] {
 cursor: default;
 pointer-events: none;
 color: green;
 cursor: default;
}
<a href="index.html" aria-current="page">Post 1 link</a>

You can check the live demo on fiddle.

© 2024 Copyrights reserved for web-brackets.com