This is searchable archive of our old support forums, which operated from 2012 - 2016. To find out how to get support for your current theme, please visit our support page.

Custom default settings

  • Creator
    Topic
  • #11796
    virgodesign
    Participant

    Hi,

    I wish to set some custom default options, both in the customizer and theme options, so that when a website is installed
    and activated it will show with my custom options (logo, colors, etc..).
    Which is the best practice to do this? Are there specific php files where to change the starting settings?

    Thank you very much.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Author
    Replies
  • #11799
    Jason Bobich
    Keymaster

    Hello,

    Checkout the developer docs on the Theme Options API:

    http://dev.themeblvd.com/tutorial_category/chapter-05/

    In an array for a specific option you’ve got the “std” key which points to the default value of that option. For an existing option, you can use the themeblvd_edit_option() function to modify its “std” key.

    http://dev.themeblvd.com/tutorial/add-remove-edit-theme-option/#themeblvd_edit_option

    You can get a good idea of how the theme adds and edits options for the framework by looking at /includes/theme-functions.php of the theme.

    I would suggest hooking all of your option modifications after the theme’s option modifications like this:

    function my_options() {
           // all of your option mods go here ...
    }
    add_action( 'after_setup_theme', 'my_options' );

    Note: This would go in your Child theme’s functions.php after the framework is included at the top.

    #11802
    virgodesign
    Participant

    Very clear answer, thank you very much! 🙂

Viewing 2 replies - 1 through 2 (of 2 total)
  • The forum ‘Barely Corporate Responsive WordPress Theme’ is closed to new topics and replies.