user image

Shilpa
Published in : 2022-02-26

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 Date : 2022-02-26

Best answers

10

Best answers

10

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 Date : 2022-02-27

Best answers

34

Best answers

34

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.

Leave a comment

Join us

Join our community and get the chance to solve your code issues & share your opinion with us

Sign up Now

Related posts

Add custom fields in user profile and display in Dashboard
Publish date: 2021-07-27 | Comments: 6

Tag: Wordpress

[solved] undefined $post->ID in WP_Query()
Publish date: 2022-01-30 | Comments: 2

Tag: Wordpress

How to run wordpress with different themes in main domain and subdomain?
Publish date: 2022-03-01 | Comments: 1

Tag: Wordpress

A Site Kit WordPress plugin bug.
Publish date: 2022-02-10 | Comments: 2

Tag: Wordpress

Cpanel to Webmin migration 503 error
Publish date: 2021-08-12 | Comments: 4

Tag: Wordpress

Issue with generating Thumbnails for PDF file format.
Publish date: 2022-02-26 | Comments: 1

Tag: Wordpress

A custom WordPress Login page and URL
Publish date: 2022-02-10 | Comments: 2

Tag: Wordpress

What is the best reference to the most used WordPress functions?
Publish date: 2022-02-09 | Comments: 2

Tag: Wordpress