• Resolved VoidIndustries

    (@voidindustries)


    On Insert Media modal window, on the right side there are the ATTACHMENT DISPLAY SETTINGS and the Link To option. Is there a way to make this default to one option, like None?

    I can’t figure out what determines the starting option, on some of my sites I have an option, on others other option. It is a pain to change it every time you need to upload a photo, when you have a lot of them.

    Thanks in advance!

Viewing 5 replies - 1 through 5 (of 5 total)
  • Hello!

    I found this snippet that you can paste into your functions.php

    add_action( 'after_setup_theme', 'default_attachment_display_settings' );
    /**
     * Set the Attachment Display Settings "Link To" default to "none"
     *
     * This function is attached to the 'after_setup_theme' action hook.
     */
    function default_attachment_display_settings() {
    	update_option( 'image_default_align', 'left' );
    	update_option( 'image_default_link_type', 'none' );
    	update_option( 'image_default_size', 'large' );
    }

    I found this at: http://bavotasan.com/2013/set-default-attachment-display-settings-in-wordpress/

    let me know how that works!

    @purcebr:Thank you contributing to the forums but please do not encourage people to edit theme files directly. At best, they will lose all of their changes when they update the theme. At worst, they could bring their site down. They should be recommended to create a child theme for their changes.

    Thread Starter VoidIndustries

    (@voidindustries)

    @purcebr: Thanks a lot! It works.

    And I am doing this in a child theme already @esmi 🙂

    OK – that’s true – I forgot that functions.php gets overwritten when a theme is replaced. Please create a child theme, and paste the code in a functions.php file that you create in that child theme folder.

    @voidindustries great, glad to help!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Default Option for Attachement Display Settings’ is closed to new replies.