Home Forums Theme support Cucina Theme Image Attachement Pages

This topic contains 1 reply, has 2 voices, and was last updated by  7Theme Support 3 years, 9 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • Is there a way within the theme to turn off the image attachment pages. My client hates that you can click on an image and it goes to an attachment page. I have tried to put code in the functions.php page
    add_filter( ‘the_content’, ‘attachment_image_link_remove_filter’ ); function attachment_image_link_remove_filter( $content ) { $content = preg_replace( array(‘{<a(.*?)(wp-att|wp-content\/uploads)[^>]*><img}’, ‘{ wp-image-[0-9]*” />}’), array(‘<img’,'” />’), $content ); return $content; }

    I also tried a few plugins as well as changing my permalinks setting in Yoast and not nothing seems to work.

    http://www.lucianorestaurants.com

    Thank You

    Hi,

    I’m sorry, this is absolute not part of the theme or the job of the theme, it’s a WordPress core function.

    But normally you don’t need a plugin or function for it, when you add an image you can always decide if you want to add an image without link, refer to attachment page or refer to the images itself. Please check the settings on the right when you insert an image….

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.