__( 'Primary Menu', 'Blocks' ),
) );
/**
* Enable custom background support
*/
add_theme_support( 'custom-background' );
/*Allows theme developers to link a custom stylesheet file to the TinyMCE visual editor. */
function my_theme_add_editor_styles() {
add_editor_style( 'custom-editor-style.css' );
}
add_action( 'init', 'my_theme_add_editor_styles' );
}
endif; // Blocks_setup
add_action( 'after_setup_theme', 'Blocks_setup' );
if ( function_exists( 'add_theme_support' ) ) {
add_theme_support( 'post-thumbnails' ); } //Adds thumbnails compatibility to the theme
set_post_thumbnail_size( true ); // Sets the Post Main Thumbnails
add_image_size( 'recent-thumbnails', 80, 93, true ); // Sets Recent Posts Thumbnails
add_image_size( 'related-thumbnails', 110, 75, true ); // Sets Recent Posts Thumbnails
/*
* Helper function to return the theme option value. If no value has been saved, it returns $default.
* Needed because options are saved as serialized strings.
*
* This code allows the theme to work without errors if the Options Framework plugin has been disabled.
*/
if ( !function_exists( 'of_get_option' ) ) {
function of_get_option($name, $default = false) {
$optionsframework_settings = get_option('optionsframework');
// Gets the unique option id
$option_name = $optionsframework_settings['id'];
if ( get_option($option_name) ) {
$options = get_option($option_name);
}
if ( isset($options[$name]) ) {
return $options[$name];
} else {
return $default;
}
}
}
/* * Loads the Options Panel * * If you're loading from a child theme use stylesheet_directory * instead of template_directory */
if ( !function_exists( 'optionsframework_init' ) ) { define( 'OPTIONS_FRAMEWORK_DIRECTORY', get_template_directory_uri() . '/inc/' ); require_once dirname( __FILE__ ) . '/inc/options-framework.php'; }
// Widget - SHORT HEADLINE FROM SPECIFIC CATEGORY AND THUMBNAIL
class Posts_From_Category_Thumbnail extends WP_Widget {
function Posts_From_Category_Thumbnail() {
/* Widget settings. */
$widget_ops = array(
'classname' => 'postsfromcat-thumb',
'description' => 'Allows you to display a list of recent posts within a particular category. Includes Thumbnail on left.');
/* Widget control settings. */
$control_ops = array(
'width' => 250,
'height' => 250,
'id_base' => 'postsfromcat-thumb-widget');
/* Create the widget. */
$this->WP_Widget('postsfromcat-thumb-widget', 'Blocks Theme - Posts from Cat w/ Thumbnail', $widget_ops, $control_ops );
}
function form ($instance) {
/* Set up some default widget settings. */
$defaults = array('numberposts' => '5','catid'=>'1','title'=>'','rss'=>'');
$instance = wp_parse_args( (array) $instance, $defaults ); ?>
';
$out .= 'More News ';
//print the widget for the sidebar
echo $before_widget;
echo $before_title.$title.$after_title;
echo $out;
echo $after_widget;
}
}
function ahspfc_load_widgets() {
register_widget('Posts_From_Category_Thumbnail');
}
add_action('widgets_init', 'ahspfc_load_widgets');
// Widget - SHORT HEADLINE FROM SPECIFIC CATEGORY
class Posts_From_Category extends WP_Widget {
function Posts_From_Category() {
/* Widget settings. */
$widget_ops = array(
'classname' => 'postsfromcat',
'description' => 'Allows you to display a list of recent posts from within a particular category.');
/* Widget control settings. */
$control_ops = array(
'width' => 250,
'height' => 250,
'id_base' => 'postsfromcat-widget');
/* Create the widget. */
$this->WP_Widget('postsfromcat-widget', 'Blocks Theme - Posts from a Category', $widget_ops, $control_ops );
}
function form ($instance) {
/* Set up some default widget settings. */
$defaults = array('numberposts' => '5','catid'=>'1','title'=>'','rss'=>'');
$instance = wp_parse_args( (array) $instance, $defaults ); ?>