add_action( 'after_setup_theme', 'my_child_theme_setup' ); function my_child_theme_setup() { // We are providing our own filter for excerpt_length (or using the unfiltered value) remove_filter( 'excerpt_length', 'ntp_framework_excerpt_length' ); ... } For more information on hooks, actions, and filters, see http://codex.wordpress.org/Plugin_API. -----------------------------------------------------------------------------------*/ /** -------------------------------------------------------------------------------- * Set the $content_width for things such as video embeds. * --------------------------------------------------------------------------------- **/ if ( !isset( $content_width ) ) $content_width = 560; /** --------------------------------------------------------------------------------- * Tell WordPress to run ntp_framework_setup() when the 'after_setup_theme' hook is run. * --------------------------------------------------------------------------------- **/ add_action( 'after_setup_theme', 'ntp_framework_setup' ); // To override ntp_framework_setup() in a child theme, add your own // ntp_framework_setup to your child theme's functions.php file. function ntp_framework_setup() { // This theme styles the visual editor with editor-style.css to match the theme style. add_editor_style(); // Add theme support for automatic feed links. add_theme_support( 'automatic-feed-links' ); // Add theme support for post thumbnails (featured images). add_theme_support( 'post-thumbnails' ); // Add theme support for Theme Layouts - script for creating dynamic layouts add_theme_support( 'theme-layouts', array( '1col-fixed', '2c-r-fixed', '2c-l-fixed', '3c-m-fixed' ) ); require_once( get_template_directory() . '/includes/functions/layouts.php' ); // Add theme support for custom backgrounds add_custom_background( 'ntp_framework_custom_background_callback' ); // This theme uses wp_nav_menu() in one location. register_nav_menus( array( 'primary' => __( 'Primary Navigation', 'ntp_framework' ), 'secondary' => __( 'Secondary Navigation', 'ntp_framework' ) ) ); // --------------------------------------------------------- // Make theme available for translation // Translations can be filed in the /languages/ directory load_theme_textdomain( 'ntp_framework', get_template_directory() . '/languages' ); $locale = get_locale(); $locale_file = get_template_directory() . "/languages/$locale.php"; if ( is_readable($locale_file) ) require_once($locale_file); // --------------------------------------------------------- // Get the page number function ntp_framework_get_page_number() { if ( get_query_var('paged') ) { print ' | ' . __( 'Page ' , 'ntp_framework') . get_query_var('paged'); } } // end ntp_framework_get_page_number // Add ntp_framework widgets to the 'widgets_init' action hook. add_action( 'widgets_init', 'ntp_framework_register_widgets' ); // Widgets require_once( get_template_directory() . '/includes/widgets/social.php' ); } // end ntp_framework_theme_setup // --------------------------------------------------------------------------------- // Custom Background Callback // --------------------------------------------------------------------------------- function ntp_framework_custom_background_callback() { /* Get the background image. */ $image = get_background_image(); /* If there's an image, just call the normal WordPress callback. We won't do anything here. */ if ( !empty( $image ) ) { _custom_background_cb(); return; } /* Get the background color. */ $color = get_background_color(); /* If no background color, return. */ if ( empty( $color ) ) return; /* Use 'background' instead of 'background-color'. */ $style = "background: #{$color};"; ?> 'Gray Button', 'selector' => 'a', 'classes' => 'gray-button' ), array( 'title' => 'Pink Button', 'selector' => 'a', 'classes' => 'pink-button' ), array( 'title' => 'Green Button', 'selector' => 'a', 'classes' => 'green-button' ), array( 'title' => 'Blue Button', 'selector' => 'a', 'classes' => 'blue-button' ), array( 'title' => 'Aqua Button', 'selector' => 'a', 'classes' => 'aqua-button' ), array( 'title' => 'Callout Box', 'block' => 'div', 'classes' => 'callout', 'wrapper' => true ), array( 'title' => 'Alert white', 'block' => 'div', 'classes' => 'alert white', 'wrapper' => true ), array( 'title' => 'Alert red', 'block' => 'div', 'classes' => 'alert red', 'wrapper' => true ) ); $settings['style_formats'] = json_encode( $style_formats ); return $settings; } // --------------------------------------------------------------------------------- // Register widgetized areas // --------------------------------------------------------------------------------- function ntp_framework_register_widgets() { // Header widget register_sidebar( array ( 'name' => 'Header Widget Area', 'id' => 'header_widget_area', 'before_widget' => '
', 'after_widget' => "
", 'before_title' => '

', 'after_title' => '

', ) ); // Area 1 register_sidebar( array ( 'name' => 'Primary Widget Area', 'id' => 'primary_widget_area', 'before_widget' => '
  • ', 'after_widget' => "
  • ", 'before_title' => '

    ', 'after_title' => '

    ', ) ); // Area 2 register_sidebar( array ( 'name' => 'Secondary Widget Area', 'id' => 'secondary_widget_area', 'before_widget' => '
  • ', 'after_widget' => "
  • ", 'before_title' => '

    ', 'after_title' => '

    ', ) ); // Footer 1 register_sidebar( array ( 'name' => 'Footer 1', 'id' => 'footer1', 'before_widget' => '
    ', 'after_widget' => "
    ", 'before_title' => '

    ', 'after_title' => '

    ', ) ); // Footer 2 register_sidebar( array ( 'name' => 'Footer 2', 'id' => 'footer2', 'before_widget' => '
    ', 'after_widget' => "
    ", 'before_title' => '

    ', 'after_title' => '

    ', ) ); // Footer 3 register_sidebar( array ( 'name' => 'Footer 3', 'id' => 'footer3', 'before_widget' => '
    ', 'after_widget' => "
    ", 'before_title' => '

    ', 'after_title' => '

    ', ) ); // Widgets Template register_sidebar( array ( 'name' => 'Widgets Template', 'id' => 'widgets_template', 'before_widget' => '
    ', 'after_widget' => "
    ", 'before_title' => '

    ', 'after_title' => '

    ', ) ); } // end ntp_framework_register_widgets // --------------------------------------------------------------------------------- // Template for comments and pingbacks. // To override this walker in a child theme without modifying the comments template // simply create your own ntp_framework_comment(), and that function will be used instead. // Used as a callback by wp_list_comments() for displaying the comments. // --------------------------------------------------------------------------------- if ( ! function_exists( 'ntp_framework_comment' ) ) : function ntp_framework_comment( $comment, $args, $depth ) { $GLOBALS['comment'] = $comment; switch ( $comment->comment_type ) : case '' : ?>
  • id="li-comment-">
    says:', 'ntp_framework' ), sprintf( '%s', get_comment_author_link() ) ); ?>
    comment_approved == '0' ) : ?>
    $depth, 'max_depth' => $args['max_depth'] ) ) ); ?>
  • , before wp_head function ntp_framework_after_header() { do_action('ntp_framework_after_header'); } // between #header and #secondary-nav (if #secondary-nav is used) function ntp_framework_before_main() { do_action('ntp_framework_before_main'); } // between #secondary-nav and #main // Located in footer.php function ntp_framework_before_footer() { do_action('ntp_framework_before_footer'); } // between #main and #footer function ntp_framework_after_footer() { do_action('ntp_framework_after_footer'); } // #footer and #wrapper function ntp_framework_after() { do_action('ntp_framework_after'); } // the very last thing before // Add author credits add_action('ntp_framework_after','ntp_framework_about_text'); function ntp_framework_about_text() { ?>

    WordPress theme from Nordic Themepark.', 'ntp_framework' )); ?>