tag in the document head, and expect WordPress to * provide it for us. */ add_theme_support( 'title-tag' ); /* * Enable support for Post Thumbnails on posts and pages. * * @link https://developer.wordpress.org/themes/functionality/featured-images-post-thumbnails/ */ add_theme_support( 'post-thumbnails' ); // This theme uses wp_nav_menu() in one location. register_nav_menus( array( 'primary' => esc_html__( 'Primary', 'toocheke' ), ) ); /* * 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', ) ); // Set up the WordPress core custom background feature. add_theme_support( 'custom-background', apply_filters( 'toocheke_custom_background_args', array( 'default-color' => 'f5f5f5', 'default-image' => '', ) ) ); // Add theme support for selective refresh for widgets. add_theme_support( 'customize-selective-refresh-widgets' ); /** * Add support for core custom logo. * * @link https://codex.wordpress.org/Theme_Logo */ add_theme_support( 'custom-logo', array( 'height' => 60, 'width' => 60, 'flex-width' => true, 'flex-height' => true, ) ); } endif; add_action( 'after_setup_theme', 'toocheke_setup' ); if ( ! function_exists( 'toocheke_add_editor_style' ) ) : function toocheke_add_editor_style(){ add_editor_style('dist/css/editor-style.css'); } endif; add_action( 'admin_init', 'toocheke_add_editor_style' ); /** * Set the content width in pixels, based on the theme's design and stylesheet. * * Priority 0 to make it available to lower priority callbacks. * * @global int $content_width */ if ( ! function_exists( 'toocheke_content_width' ) ) : function toocheke_content_width() { // This variable is intended to be overruled from themes. // Open WPCS issue: {@link https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/issues/1043}. // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound $GLOBALS['content_width'] = apply_filters( 'toocheke_content_width', 1140 ); } endif; add_action( 'after_setup_theme', 'toocheke_content_width', 0 ); /** * @param WP_Query|null $wp_query * @param bool $echo * * @return string * Accepts a WP_Query instance to build pagination (for custom wp_query()), * or nothing to use the current global $wp_query (eg: taxonomy term page) * * USAGE: * //uses global $wp_query * or with custom WP_Query(): * posts stuff ... * echo bootstrap_pagination($query); * ?> */ if ( ! function_exists( 'toocheke_bootstrap_comic_archive_pagination' ) ) : function toocheke_bootstrap_comic_archive_pagination( WP_Query $wp_query = null, $echo = true ) { if ( null === $wp_query ) { global $wp_query; } $pages = paginate_links( array( 'base' => str_replace( 999999999, '%#%', esc_url( get_pagenum_link( 999999999 ) ) ), 'format' => '?paged=%#%', 'current' => max( 1, get_query_var( 'paged' ) ), 'total' => $wp_query->max_num_pages, 'type' => 'array', 'show_all' => false, 'end_size' => 3, 'mid_size' => 1, 'prev_next' => true, 'prev_text' => __( '«' , 'toocheke'), 'next_text' => __( '»' , 'toocheke'), 'add_args' => false, 'add_fragment' => '' ) ); if ( is_array( $pages ) ) { //$paged = ( get_query_var( 'paged' ) == 0 ) ? 1 : get_query_var( 'paged' ); $pagination = ''; if ( $echo ) { echo $pagination; } else { return $pagination; } } return null; } endif; /** * Enqueue scripts and styles. */ if ( ! function_exists( 'toocheke_scripts' ) ) : function toocheke_scripts() { wp_enqueue_style( 'toocheke-bs-css', get_template_directory_uri() . '/dist/css/bootstrap.min.css' ); wp_enqueue_style( 'toocheke-bs-smartmenus', get_template_directory_uri() . '/dist/css/jquery.smartmenus.bootstrap-4.css' ); wp_register_style('toocheke-font-awesome', '//use.fontawesome.com/releases/v5.8.1/css/all.css', array(), null, 'all'); wp_enqueue_style('toocheke-font-awesome'); wp_register_style('toocheke-owl-carousel', '//cdnjs.cloudflare.com/ajax/libs/OwlCarousel2/2.3.4/assets/owl.carousel.min.css', array(), null, 'all'); wp_enqueue_style('toocheke-owl-carousel'); wp_register_style('toocheke-owl-theme-default', '//cdnjs.cloudflare.com/ajax/libs/OwlCarousel2/2.3.4/assets/owl.theme.default.css', array(), null, 'all'); wp_enqueue_style('toocheke-owl-theme-default'); wp_register_style('toocheke-lato', '//fonts.googleapis.com/css?family=Lato:regular,medium,bold,bolditalic,semibold', array(), null, 'all'); wp_enqueue_style('toocheke-lato'); wp_enqueue_style( 'toocheke-style', get_stylesheet_uri() ); wp_register_script('popper', '//cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js', false, '', true); wp_enqueue_script('popper'); wp_register_script('owl-carousel', '//cdnjs.cloudflare.com/ajax/libs/OwlCarousel2/2.3.4/owl.carousel.min.js', false, '', true); wp_enqueue_script('owl-carousel'); wp_enqueue_script( 'toocheke-tether', get_template_directory_uri() . '/src/js/tether.min.js', array(), '20190428', true ); wp_enqueue_script( 'toocheke-bootstrap', get_template_directory_uri() . '/src/js/bootstrap.min.js', array('jquery'), '20190428', true ); wp_enqueue_script( 'toocheke-skip-link-focus-fix', get_template_directory_uri() . '/src/js/skip-link-focus-fix.js', array(), '20190428', true ); wp_enqueue_script( 'toocheke-jquery-smartmenus', get_template_directory_uri() . '/src/js/jquery.smartmenus.min.js', array(), '20190428', true ); wp_enqueue_script( 'toocheke-jquery-smartmenus-bs4', get_template_directory_uri() . '/src/js/jquery.smartmenus.bootstrap-4.min.js', array(), '20190428', true ); wp_enqueue_script( 'toocheke-clipboard', get_template_directory_uri() . '/src/js/clipboard.min.js', array(), '20190428', true ); wp_enqueue_script( 'toocheke-functions', get_template_directory_uri() . '/src/js/functions.js', array(), '20190428', true ); if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { wp_enqueue_script( 'comment-reply' ); } } endif; add_action( 'wp_enqueue_scripts', 'toocheke_scripts' ); /* * Register required plugins */ require_once get_template_directory() . '/inc/class-tgm-plugin-activation.php'; add_action( 'tgmpa_register', 'toocheke_register_required_plugins' ); /* * Register the required plugins for this theme. */ if ( ! function_exists( 'toocheke_register_required_plugins' ) ) : function toocheke_register_required_plugins() { /* * Array of plugin arrays. Required keys are name and slug. * If the source is NOT from the .org repo, then source is also required. */ $plugins = array( // Include the Toocheke plugin bundled with a theme. array( 'name' => 'Toocheke Companion', 'slug' => 'toocheke-companion', 'source' => 'https://leetoo.net/lib/toocheke-companion.zip', // The plugin source. 'required' => true, // If false, the plugin is only 'recommended' instead of required. 'version' => '', // E.g. 1.0.0. If set, the active plugin must be this version or higher. If the plugin version is higher than the plugin version installed, the user will be notified to update the plugin. 'force_activation' => true, // If true, plugin is activated upon theme activation and cannot be deactivated until theme switch. 'force_deactivation' => true, // If true, plugin is deactivated upon theme switch, useful for theme-specific plugins. 'external_url' => '', // If set, overrides default API URL and points to an external URL. 'is_callable' => '', // If set, this callable will be be checked for availability to determine if a plugin is active. ), ); /* * Array of configuration settings. Amend each line as needed. * */ $config = array( 'id' => 'toocheke', // Unique ID for hashing notices for multiple instances of TGMPA. 'default_path' => '', // Default absolute path to bundled plugins. 'menu' => 'toocheke-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' => false, // If 'dismissable' is false, this message will be output at top of nag. 'is_automatic' => true, // Automatically activate plugins after installation or not. 'message' => '', // Message to output right before the plugins table. ); tgmpa( $plugins, $config ); } endif; if ( ! function_exists( 'toocheke_load_about_widget' ) ) : function toocheke_load_about_widget() { register_widget( 'toocheke_about_widget' ); } endif; add_action( 'widgets_init', 'toocheke_load_about_widget' ); if ( ! class_exists( 'toocheke_about_widget' ) ) : class toocheke_about_widget extends WP_Widget { public function __construct() { $widget_details = array( 'classname' => 'toocheke_about_widget', 'description' => 'Creates an about section consisting of a title, image/avatar, and a description. Ideal for the right sidebar on the Toocheke WP theme.' ); parent::__construct( 'toocheke_about_widget', 'Toocheke: About Us', $widget_details ); add_action('admin_enqueue_scripts', array($this, 'toocheke_about_us_widget_assets')); } public function toocheke_about_us_widget_assets() { wp_enqueue_script('media-upload'); wp_enqueue_script('thickbox'); wp_enqueue_script( 'toocheke-bootstrap', get_template_directory_uri() . '/dist/js/toocheke-media-upload.js', array('jquery'), '20190428', true ); wp_enqueue_style('thickbox'); } public function widget( $args, $instance ) { echo $args['before_widget']; if ( ! empty( $instance['title'] ) ) { echo $args['before_title'] . apply_filters( 'widget_title', $instance['title'] ). $args['after_title']; } ?> ' class='about-avatar' >

'toocheke_social_media social-links', 'description' => 'Add links to your social media profiles. Ideally for the right sidebar on the Toocheke WP theme. ' ); parent::__construct( 'toocheke_social_media', 'Toocheke: Social', $widget_details ); } public function widget( $args, $instance ) { echo $args['before_widget']; if ( ! empty( $instance['title'] ) ) { echo $args['before_title'] . apply_filters( 'widget_title', $instance['title'] ). $args['after_title']; } ?>

comment_approved == '1' ): ?>