Proper Functions.php Setup….?
-
Just a question… I have been looking at several templates like the BONES… and _underscore etc. and everyone has a different method of setting up a function file..
The bones one really confuses me as it removes a whole bunch of stuff and adds things
is there a specific way to actually setup a proper functions file?
Right now I have a function file with things just added in there like this
<?php // Register Sidebar function my_custom_sides() { register_sidebar ( array( 'id' => 'top-sidebar', 'name' => __( 'Top Side' ), 'description' => __( 'Appears when using the optional Front Page template with a page set as Static Front Page', 'twentytwelve' ), 'before_title' => '<h2 class="widgettitle">', 'after_title' => '</h2>', 'before_widget' => '<li id="%1$s" class="widget %2$s">', 'after_widget' => '</li>', )); } add_action( 'widgets_init', 'my_custom_sides' ); ?>but I have read that a proper format is adding this?
if ( ! function_exists( '_optz_setup' ) ) : function _optz_setup() { load_theme_textdomain( '_optz', get_template_directory() . '/languages' ); add_theme_support( 'automatic-feed-links' ); register_nav_menus( array( 'primary' => __( 'Primary Menu', '_optz' ), ) ); add_theme_support( 'post-formats', array( 'aside', 'image', 'video', 'quote', 'link' ) ); } endif; // _optz_setup add_action( 'after_setup_theme', '_optz_setup' );Is it necessary to add the setup and after_setup_theme code? can’t i just put in a few things I want the theme to do and call it a day 😀
or do i have to put all my side bars etc in between there?
The topic ‘Proper Functions.php Setup….?’ is closed to new replies.