';
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'];
}
?>