/**
* Hostinger blog theme functions and definitions
*
* @link https://developer.wordpress.org/themes/basics/theme-functions/
*
* @package Hostinger_blog_theme
*/
require get_template_directory() . '/inc/config.php';
require_once __DIR__ . '/vendor/autoload.php';
if ( ! defined( '_THEME_VERSION' ) ) {
$theme = wp_get_theme();
define( '_THEME_VERSION', $theme->Version );
}
/**
* Define theme updater URI
*/
if ( ! defined( 'HOSTINGER_WP_CONFIG_PATH' ) ) {
define( 'HOSTINGER_WP_CONFIG_PATH', ABSPATH . '/.private/config.json' );
}
$hostingerWpConfig = new HostingerWpConfig(HOSTINGER_WP_CONFIG_PATH);
$themeUpdaterURI = $hostingerWpConfig->getThemeUpdaterURI();
define('THEME_UPDATER', $themeUpdaterURI);
/**
*
* Check for theme updates
*
*/
use YahnisElsts\PluginUpdateChecker\v5\PucFactory;
if ( class_exists( PucFactory::class ) ) {
$htsUpdateChecker = PucFactory::buildUpdateChecker(
THEME_UPDATER,
__FILE__,
'hostinger-blog-theme'
);
}
/**
* Sets up theme defaults and registers support for various WordPress features.
*
* Note that this function is hooked into the after_setup_theme hook, which
* runs before the init hook. The init hook is too late for some features, such
* as indicating support for post thumbnails.
*/
function hostinger_blog_theme_setup() {
/*
* Make theme available for translation.
* Translations can be filed in the /languages/ directory.
* If you're building a theme based on Hostinger blog theme, use a find and replace
* to change 'hostinger-blog-theme' to the name of your theme in all the template files.
*/
load_theme_textdomain( 'hostinger-blog-theme', get_template_directory() . '/languages' );
/*
* Let WordPress manage the document title.
* By adding theme support, we declare that this theme does not use a
* hard-coded