__( 'Header menu', 'bootmag' ), ) ); } endif; // bootmag_setup add_action( 'after_setup_theme', 'bootmag_setup' ); // title tag implementation with backward compatibility if ( ! function_exists( '_wp_render_title_tag' ) ) { function bootmag_render_title() { ?> <?php wp_title( '|', true, 'right' ); ?> __( 'Sidebar', 'bootmag' ), 'id' => 'sidebar-1', 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); } add_action( 'widgets_init', 'bootmag_widgets_init' ); /** * Enqueue scripts and styles */ function bootmag_scripts() { // load bootstrap css wp_enqueue_style( 'bootmag-bootstrap', get_template_directory_uri() . '/includes/resources/bootstrap/css/bootstrap.min.css' ); // load Font Awesome css wp_enqueue_style( 'bootmag-font-awesome', get_template_directory_uri() . '/includes/css/font-awesome.min.css', false, '4.1.0' ); // load Flexslider js wp_enqueue_script('flexslider', get_stylesheet_directory_uri() . '/includes/js/jquery.flexslider-min.js', array('jquery')); // load Flexslider css wp_enqueue_style('stylesheetflex', get_stylesheet_directory_uri() . '/includes/css/flexslider.css', 'style'); // load bootmag styles wp_enqueue_style( 'bootmag-style', get_stylesheet_uri() ); // load bootstrap js wp_enqueue_script('bootmag-bootstrapjs', get_template_directory_uri().'/includes/resources/bootstrap/js/bootstrap.min.js', array('jquery') ); // load custom js wp_enqueue_script('bootmag-customjs', get_template_directory_uri().'/includes/js/custom.js', array('jquery') ); // load bootstrap wp js wp_enqueue_script( 'bootmag-bootstrapwp', get_template_directory_uri() . '/includes/js/bootstrap-wp.js', array('jquery') ); wp_enqueue_script( 'bootmag-skip-link-focus-fix', get_template_directory_uri() . '/includes/js/skip-link-focus-fix.js', array(), '20130115', true ); if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { wp_enqueue_script( 'comment-reply' ); } if ( is_singular() && wp_attachment_is_image() ) { wp_enqueue_script( 'bootmag-keyboard-image-navigation', get_template_directory_uri() . '/includes/js/keyboard-image-navigation.js', array( 'jquery' ), '20120202' ); } } add_action( 'wp_enqueue_scripts', 'bootmag_scripts'); /** * Custom template tags for this theme. */ require get_template_directory() . '/includes/template-tags.php'; /** * Custom functions that act independently of the theme templates. */ require get_template_directory() . '/includes/extras.php'; /** * Customizer additions. */ require get_template_directory() . '/includes/customizer.php'; /** * Load Jetpack compatibility file. */ require get_template_directory() . '/includes/jetpack.php'; /** * Load custom WordPress nav walker. */ require get_template_directory() . '/includes/bootstrap-wp-navwalker.php'; /** * Load Theme functions. */ require get_template_directory() . '/includes/theme-actions.php'; /** * Load Breadcrumbs functions. */ require get_template_directory() . '/includes/breadcrumbs.php'; /** * tgm-plugin-activation */ require_once get_template_directory() . '/includes/class-tgm-plugin-activation.php'; /** * Category count function */ function bootmag_get_category_count($input = '') { global $wpdb; if($input == '') { $category = get_the_category(); return $category[0]->category_count; } elseif(is_numeric($input)) { $SQL = "SELECT $wpdb->term_taxonomy.count FROM $wpdb->terms, $wpdb->term_taxonomy WHERE $wpdb->terms.term_id=$wpdb->term_taxonomy.term_id AND $wpdb->term_taxonomy.term_id=$input"; return $wpdb->get_var($SQL); } else { $SQL = "SELECT $wpdb->term_taxonomy.count FROM $wpdb->terms, $wpdb->term_taxonomy WHERE $wpdb->terms.term_id=$wpdb->term_taxonomy.term_id AND $wpdb->terms.slug='$input'"; return $wpdb->get_var($SQL); } } /** * TGM plugins */ function bootmag_register_required_plugins() { $plugins = array( array( 'name' => 'WP Review', 'slug' => 'wp-review', 'required' => false, ), array( 'name' => 'Max Mega Menu', 'slug' => 'megamenu', 'required' => false, ) ); $config = array( 'default_path' => '', 'menu' => 'tgmpa-install-plugins', 'has_notices' => true, 'dismissable' => true, 'dismiss_msg' => '', 'is_automatic' => false, 'message' => '', 'strings' => array( 'page_title' => __('Install Required Plugins', 'bootmag'), 'menu_title' => __('Install Plugins', 'bootmag'), 'installing' => __('Installing Plugin: %s', 'bootmag'), 'oops' => __('Something went wrong with the plugin API.', 'bootmag'), 'notice_can_install_required' => _n_noop('This theme requires the following plugin: %1$s.', 'This theme requires the following plugins: %1$s.','bootmag'), 'notice_can_install_recommended' => _n_noop('This theme recommends the following plugin: %1$s.', 'This theme recommends the following plugins: %1$s.','bootmag'), 'notice_cannot_install' => _n_noop('Sorry, but you do not have the correct permissions to install the %s plugin. Contact the administrator of this site for help on getting the plugin installed.', 'Sorry, but you do not have the correct permissions to install the %s plugins. Contact the administrator of this site for help on getting the plugins installed.','bootmag'), 'notice_can_activate_required' => _n_noop('The following required plugin is currently inactive: %1$s.', 'The following required plugins are currently inactive: %1$s.','bootmag'), 'notice_can_activate_recommended' => _n_noop('The following recommended plugin is currently inactive: %1$s.', 'The following recommended plugins are currently inactive: %1$s.','bootmag'), 'notice_cannot_activate' => _n_noop('Sorry, but you do not have the correct permissions to activate the %s plugin. Contact the administrator of this site for help on getting the plugin activated.', 'Sorry, but you do not have the correct permissions to activate the %s plugins. Contact the administrator of this site for help on getting the plugins activated.','bootmag'), 'notice_ask_to_update' => _n_noop('The following plugin needs to be updated to its latest version to ensure maximum compatibility with this theme: %1$s.', 'The following plugins need to be updated to their latest version to ensure maximum compatibility with this theme: %1$s.','bootmag'), 'notice_cannot_update' => _n_noop('Sorry, but you do not have the correct permissions to update the %s plugin. Contact the administrator of this site for help on getting the plugin updated.', 'Sorry, but you do not have the correct permissions to update the %s plugins. Contact the administrator of this site for help on getting the plugins updated.','bootmag'), 'install_link' => _n_noop('Begin installing plugin', 'Begin installing plugins','bootmag'), 'activate_link' => _n_noop('Begin activating plugin', 'Begin activating plugins','bootmag'), 'return' => __('Return to Required Plugins Installer', 'bootmag'), 'plugin_activated' => __('Plugin activated successfully.', 'bootmag'), 'complete' => __('All plugins installed and activated successfully. %s', 'bootmag'), 'nag_type' => 'updated' ) ); tgmpa($plugins, $config); } add_action('tgmpa_register', 'bootmag_register_required_plugins');