0

I'm using Wordpress 4.2 and I'd like to remove the links from some images.

I've seen that I could use this :

enter image description here

The problem is I don't see that on my interface :

enter image description here

Where can I find the same attachement display setting in WP 4.2 ?

1

The option for setting the url to none using "Attachment Display Settings" is available through the gallery option, using "Add Media". How are you adding your images—through featured image or directly in your post/page? You can remove the my image if it's in the post itself.

For featured images, you'll have to go into your template file and remove the link wrapper from your images. If you have conditions for this functionality, like for example, only certain categories become unlinked, you can add a condition for that circumstance.

<?php if ( has_post_thumbnail() ) : ?>
    <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>">
    <?php the_post_thumbnail(); ?>
    </a>
<?php endif; ?>

to this:

<?php if ( has_post_thumbnail() ) : ?>
    <?php the_post_thumbnail(); ?>
<?php endif; ?>
1
  • Can you do the same, but only for a specific extension, for instance .gif?
    – paranza
    Dec 5 '16 at 0:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.