for posts and comments.
add_theme_support( 'automatic-feed-links' );
// Let WordPress manage the document title.
add_theme_support( 'title-tag' );
// Register a menu location.
register_nav_menu( 'primary', __( 'Navigation Menu', 'blogfeedly' ) );
// Add support for featured images.
add_theme_support( 'post-thumbnails' );
set_post_thumbnail_size( 1560, 9999 );
// Enable support for custom logo.
add_theme_support( 'custom-logo', array(
'height' => '240',
'width' => '400',
'flex-width' => true,
'flex-height' => true,
) );
/*
* Switch default core markup for search form, comment form, and comments
* to output valid HTML5.
*/
add_theme_support( 'html5', array(
'search-form',
'comment-form',
'comment-list',
'gallery',
'caption'
) );
}
endif;
add_action( 'after_setup_theme', 'stsblogfeedly_setup' );
/**
* Register four widget areas in the footer.
*/
function stsblogfeedly_widgets_init() {
register_sidebar( array(
'name' => __( 'Footer Widget Area 1', 'blogfeedly' ),
'id' => 'sidebar-1',
'description' => __( 'Appears in the footer section of the site', 'blogfeedly' ),
'before_widget' => '',
'before_title' => '
'
) );
register_sidebar( array(
'name' => __( 'Footer Widget Area 2', 'blogfeedly' ),
'id' => 'sidebar-2',
'description' => __( 'Appears in the footer section of the site', 'blogfeedly' ),
'before_widget' => '',
'before_title' => ''
) );
register_sidebar( array(
'name' => __( 'Footer Widget Area 3', 'blogfeedly' ),
'id' => 'sidebar-3',
'description' => __( 'Appears in the footer section of the site', 'blogfeedly' ),
'before_widget' => '',
'before_title' => ''
) );
register_sidebar( array(
'name' => __( 'Footer Widget Area 4', 'blogfeedly' ),
'id' => 'sidebar-4',
'description' => __( 'Appears in the footer section of the site', 'blogfeedly' ),
'before_widget' => '',
'before_title' => ''
) );
register_sidebar( array(
'name' => __( 'Sidebar Widget Area', 'blogfeedly' ),
'id' => 'right-sidebar-1',
'description' => __( 'Appears in the sidebar section of the site', 'blogfeedly' ),
'before_widget' => '',
'before_title' => ''
) );
}
add_action( 'widgets_init', 'stsblogfeedly_widgets_init' );
/**
* Register Karla Google font.
*/
function stsblogfeedly_font_url() {
$font_url = add_query_arg( 'family', urlencode( 'Karla:400,400i,700,700i' ), "https://fonts.googleapis.com/css" );
return $font_url;
}
/**
* Handle JavaScript detection.
*/
function stsblogfeedly_javascript_detection() {
echo "\n";
}
add_action( 'wp_head', 'stsblogfeedly_javascript_detection', 0 );
/**
* Enqueue scripts and styles.
*/
function stsblogfeedly_scripts_styles() {
// Add Karla font, used in the main stylesheet.
wp_enqueue_style( 'stsblogfeedly-fonts', stsblogfeedly_font_url(), array(), null );
// Load the main stylesheet.
wp_enqueue_style( 'stsblogfeedly-style', get_stylesheet_uri() );
// Load the IE specific stylesheet.
wp_enqueue_style( 'stsblogfeedly-ie', get_template_directory_uri() . '/css/ie.css', array( 'stsblogfeedly-style' ), '1.6.0' );
wp_style_add_data( 'stsblogfeedly-ie', 'conditional', 'lt IE 9' );
// Load the html5 shiv.
wp_enqueue_script( 'stsblogfeedly-html5', get_template_directory_uri() . '/js/html5.js', array(), '3.7.3' );
wp_script_add_data( 'stsblogfeedly-html5', 'conditional', 'lt IE 9' );
// Add JS to pages with the comment form to support sites with threaded comments (when in use).
if ( is_singular() && comments_open() && get_option( 'thread_comments' ) )
wp_enqueue_script( 'comment-reply' );
// Add custom scripts.
wp_enqueue_script( 'stsblogfeedly-script', get_template_directory_uri() . '/js/custom.js', array( 'jquery' ), '1.6.0', true );
}
add_action( 'wp_enqueue_scripts', 'stsblogfeedly_scripts_styles' );
/**
* Change wp_nav_menu() fallback, wp_page_menu(), container class and depth.
*/
function stsblogfeedly_page_menu_args( $args ) {
$args['depth'] = 1;
$args['menu_class'] = 'menu-wrap';
return $args;
}
add_filter( 'wp_page_menu_args', 'stsblogfeedly_page_menu_args' );
/**
* Add custom classes to the array of body classes.
*/
function stsblogfeedly_body_class( $classes ) {
// Check if it is a single author blog.
if ( ! is_multi_author() )
$classes[] = 'single-author';
// Check if animated navigation option is checked.
if ( stsblogfeedly_get_option( 'animated_nav' ) )
$classes[] = 'animated-navigation';
// Add a class of no-avatars if avatars are disabled.
if ( ! get_option( 'show_avatars' ) ) {
$classes[] = 'no-avatars';
}
// Add a class of hfeed to non-singular pages.
if ( ! is_singular() ) {
$classes[] = 'hfeed';
}
return $classes;
}
add_filter( 'body_class', 'stsblogfeedly_body_class' );
/**
* Customize the archive title.
*/
function stsblogfeedly_archive_title( $title ) {
if ( is_category() ) {
$title = sprintf( __( 'All posts in %s', 'blogfeedly' ), '' . single_cat_title( '', false ) . '' );
} elseif ( is_tag() ) {
$title = sprintf( __( 'All posts tagged %s', 'blogfeedly' ), '' . single_tag_title( '', false ) . '' );
} elseif ( is_author() ) {
$title = sprintf( __( 'All posts by %s', 'blogfeedly' ), '' . get_the_author() . '' );
} elseif ( is_year() ) {
$title = sprintf( __( 'All posts in %s', 'blogfeedly' ), '' . get_the_date( _x( 'Y', 'yearly archives date format', 'blogfeedly' ) ) . '' );
} elseif ( is_month() ) {
$title = sprintf( __( 'All posts in %s', 'blogfeedly' ), '' . get_the_date( _x( 'F Y', 'monthly archives date format', 'blogfeedly' ) ) . '' );
} elseif ( is_day() ) {
$title = sprintf( __( 'All posts dated %s', 'blogfeedly' ), '' . get_the_date( _x( 'F j, Y', 'daily archives date format', 'blogfeedly' ) ) . '' );
}
return $title;
}
add_filter( 'get_the_archive_title', 'stsblogfeedly_archive_title' );
/**
* Customize tag cloud widget.
*/
function stsblogfeedly_custom_tag_cloud_widget( $args ) {
$args['number'] = 0;
$args['largest'] = 14;
$args['smallest'] = 14;
$args['unit'] = 'px';
return $args;
}
add_filter( 'widget_tag_cloud_args', 'stsblogfeedly_custom_tag_cloud_widget' );
if ( ! function_exists( 'stsblogfeedly_excerpt_more' ) && ! is_admin() ) :
/**
* Replaces "[...]" (appended to automatically generated excerpts) with ... and a 'Read More' link.
*/
function stsblogfeedly_excerpt_more( $more ) {
$link = sprintf( '',
esc_url( get_permalink( get_the_ID() ) ),
__( 'Read ', 'blogfeedly' )
);
return '… ' . $link;
}
add_filter( 'excerpt_more', 'stsblogfeedly_excerpt_more' );
endif;
/**
* Custom template tags for this theme.
*/
require get_template_directory() . '/includes/template-tags.php';
/**
* Theme options.
*/
require get_template_directory() . '/includes/theme-options.php';
/**
* Customizer additions.
*/
require get_template_directory() . '/includes/customizer.php';
/**
* Gutenberg additions.
*/
require get_template_directory() . '/includes/gutenberg.php';
/**
* Load Jetpack compatibility file.
*/
require get_template_directory() . '/includes/jetpack.php';
/**
* Copyright and License for Upsell button by Justin Tadlock - 2016 © Justin Tadlock. customizer button https://github.com/justintadlock/trt-customizer-pro
*/
require_once( trailingslashit( get_template_directory() ) . 'justinadlock-customizer-button/class-customize.php' );
// Theme page start
add_action('admin_menu', 'blogfeedly_themepage');
function blogfeedly_themepage()
{
$option = get_option('blogfeedly_themepage_seen');
$awaiting = !$option ? ' 1' : '';
$theme_info = add_theme_page(__('Theme Settings', 'blogfeedly'), __('Theme Settings', 'blogfeedly').$awaiting, 'manage_options', 'blogfeedly-info.php', 'blogfeedly_info_page', 1);
}
function blogfeedly_info_page()
{
$user = wp_get_current_user();
$theme = wp_get_theme();
$parent_name = is_child_theme() ? wp_get_theme($theme->Template) : '';
$theme_name = is_child_theme() ? $theme." ".__("and", "blogfeedly")." ".$parent_name : $theme;
$demo_text = is_child_theme() ? sprintf(__("Need inspiration? Take a moment to view our theme demo for the %s parent theme %s!", "blogfeedly"), $theme, $parent_name) : __("Need inspiration? Take a moment to view our theme demo!", "blogfeedly");
$premium_text = is_child_theme() ? sprintf(__("Unlock all features by upgrading to the premium edition of %s and its parent theme %s.", "blogfeedly"), $theme, $parent_name) : sprintf(__("Unlock all features by upgrading to the premium edition of %s.", "blogfeedly"),$theme);
$option_name = 'blogfeedly_themepage_seen';
$option = get_option($option_name, null);
if (is_null($option)) {
add_option($option_name, true);
} elseif (!$option) {
update_option($option_name, true);
} ?>
'Superb Helper',
'slug' => 'superb-helper',
'required' => false,
),
);
/*
* Array of configuration settings. Amend each line as needed.
*
* TGMPA will start providing localized text strings soon. If you already have translations of our standard
* strings available, please help us make TGMPA even better by giving us access to these translations or by
* sending in a pull-request with .po file(s) with the translations.
*
* Only uncomment the strings in the config array if you want to customize the strings.
*/
$config = array(
'id' => 'blogfeedly', // Unique ID for hashing notices for multiple instances of TGMPA.
'default_path' => '', // Default absolute path to bundled plugins.
'menu' => 'tgmpa-install-plugins', // Menu slug.
'has_notices' => true, // Show admin notices or not.
'dismissable' => true, // If false, a user cannot dismiss the nag message.
'dismiss_msg' => '', // If 'dismissable' is false, this message will be output at top of nag.
'is_automatic' => false, // Automatically activate plugins after installation or not.
'message' => '', // Message to output right before the plugins table.
);
tgmpa( $plugins, $config );
}
add_action('admin_init', 'blogfeedly_spbThemesNotification', 8);
function blogfeedly_spbThemesNotification(){
$notifications = include('inc/admin_notification/Autoload.php');
$notifications->Add("blogfeedly_notification", "Unlock All Features with Blog Feedly Premium – Limited Time Offer", "
Take advantage of the up to 40% discount and unlock all features with Blog Feedly Premium.
The discount is only available for a limited time.
", "info");
$options_notification_start = array("delay"=> "-1 seconds", "wpautop" => false);
$notifications->Add("blogfeedly_notification_start", "Let's get you started with Blog Feedly!", '
Why Blog Feedly
- Easy to Use & Customize
- Search Engine Optimized
- Lightweight and Fast
- Top-notch Customer Support
View Blog Feedly Demo
Customize Blog Feedly
', "info", $options_notification_start);
$notifications->Boot();
}