/** * Ample functions related to defining constants, adding files and WordPress core functionality. * * @package ThemeGrill * @subpackage Ample * @since Ample 0.1 */ /** * Set the content width based on the theme's design and stylesheet. */ if ( ! isset( $content_width ) ) { $content_width = 710; /* pixels */ } /** * $content_width global variable adjustment as per layout option. */ function ample_content_width() { global $post; global $content_width; if ( $post ) { $layout_meta = get_post_meta( $post->ID, 'ample_page_layout', true ); } if ( empty( $layout_meta ) || is_archive() || is_search() ) { $layout_meta = 'default_layout'; } $ample_default_layout = ample_option( 'ample_default_layout', 'right_sidebar' ); if ( $layout_meta == 'default_layout' ) { if ( $ample_default_layout == 'no_sidebar_full_width' ) { $content_width = 1100; /* pixels */ } elseif ( $ample_default_layout == 'both_sidebar' ) { $content_width = 500; /* pixels */ } else { $content_width = 710; /* pixels */ } } elseif ( $layout_meta == 'no_sidebar_full_width' ) { $content_width = 1100; /* pixels */ } elseif ( $layout_meta == 'both_sidebar' ) { $content_width = 500; /* pixels */ } else { $content_width = 710; /* pixels */ } } add_action( 'template_redirect', 'ample_content_width' ); add_action( 'after_setup_theme', 'ample_setup' ); if ( ! function_exists( 'ample_setup' ) ) : /** * Sets up theme defaults and registers support for various WordPress features. * */ function ample_setup() { /* * Make theme available for translation. * Translations can be filed in the /languages/ directory. */ load_theme_textdomain( 'ample', get_template_directory() . '/languages' ); // Add default posts and comments RSS feed links to head. add_theme_support( 'automatic-feed-links' ); /* * Let WordPress manage the document title. * By adding theme support, we declare that this theme does not use a * hard-coded