Disable Comments for images

  • Author
    Posts
  • #3552
    Bob M.

    Hello!

    First, I’ll admit to being a word press newb, so I might just be missing a simple setting.  I’m playing with Mantra and am liking it alot.  However, In creating a photo gallery I noticed that when you click an image from the gallery, the page has a comments box (see <a href=”http://wpmrm.org/beta/?attachment_id=87&#8243; this page </a> ).  I would like to disable it and I just find how to do that.

    Also, I have the Share buttons turned on and they are showing up on the secondary pages, but not the presentation page, and I guess they should probably also show up on the image page as well, but that’s not too big of a deal to me.

    Thanks!

    Bob

    #3608
    Kay
    Cryout Creations Team

    Hi!

    You need to create a child theme and paste the following code in the chlild themes’ functions.php file. Or you can add this in mantra’s functions.php file but the changes will be lost when you update to another version.


    function hide_attachment_comments( $open, $post_id ) {
    $post = get_post( $post_id );
    if( $post->post_type == 'attachment' ) {
    return false;
    }
    return $open;
    }
    add_filter( 'comments_open', 'hide_attachment_comments', 10 , 2 );


    Before posting consider reading our short theme debugging instructions.
    Please read the FAQs: MantraNirvanaParabolaTempera
    Tutorials: custom menustranslating themeinstalling themecategory page with introdisabling comments Wordpress: child themescategories/posts
    Before making any modifications to your theme we strongly recommend using Child Themes.
    #3730
    Bob M.

    Thanks, I modified the functions.php and that seems to have done the trick.

    Any update on the share buttons not showing up on the presentation page?

    Bob

    #3767
    Kay
    Cryout Creations Team

    Hi!

    The share plugin attaches itself to posts or created pages. As the presentation page is neither of them it has nothing to attach to. We’ll fix that in the next theme update.


    Before posting consider reading our short theme debugging instructions.
    Please read the FAQs: MantraNirvanaParabolaTempera
    Tutorials: custom menustranslating themeinstalling themecategory page with introdisabling comments Wordpress: child themescategories/posts
    Before making any modifications to your theme we strongly recommend using Child Themes.
Viewing 4 posts - 1 through 4 (of 4 total)

The topic ‘Disable Comments for images’ is closed to new replies.