Remove the default link function of WordPress upload image

Our friends have found out when using WordPress program that if there is no manually set link for the uploaded image, clicking the image on the front end will directly jump to the direct page where the image is located. This kind of effect is a bit awkward. The theory is that the picture is the picture, and there is no need to click to open it to see the picture, unless we have special effects to make the picture enlarged directly.

If you want to solve this problem, the clumsy way is to add each picture, and then we manually set the point to the link or remove the link, but this is a little troublesome, if you forget to deal with it. Here, we collates all images into a simple way to directly cancel the default links.

function wpb_ imagelink_ setup() {
$image_ set = get_ option( ‘image_ default_ link_ type’ );

if ($image_ set !== ‘none’) {
update_ option(‘image_ default_ link_ type’, ‘none’);
}
}
add_ action(‘admin_ init’, ‘wpb_ imagelink_ setup’, 10);

Adds code to the current topic Functions.php File. Or we can use the no image link plugin, but we doesn’t think it’s necessary to use the plugin.

Related Article
Add article browsing history function to WordPress

This article was last updated on January 22, 2014. It has not been updated for more than three years. If Read more

Set the method for WordPress website to specify that the classified content will not be displayed on the home page

Sometimes, for the needs of specific content, we hope that the content of a certain category will not be displayed Read more

WordPress excludes the specified articles / categories from being displayed by on-site search

WordPress is the most used CMS program at present. As long as we need some functions, we can basically search Read more

WordPress common template function reference document

Basic template filefile namedescribe style.css Theme style file index.php Home page template file header.php Header template file single.php Single article Read more

Leave a Reply

Your email address will not be published. Required fields are marked *

*
To prove you're a person (not a spam script), type the security word shown in the picture.
Anti-spam image