Files
symfony-flex-recipes-contrib/mukadi/wordpress-bundle/1.0/wp/themes/wp-blank/functions.php
T

47 lines
976 B
PHP

<?php
declare(strict_types=1);
// Set theme defaults.
add_action('after_setup_theme', function () {
// Add post thumbnails support.
add_theme_support('post-thumbnails');
// Add title tag theme support.
add_theme_support('title-tag');
// Add HTML5 support.
add_theme_support('html5', [
'caption',
'comment-form',
'comment-list',
'gallery',
'search-form',
'widgets',
]);
register_nav_menu('main', __('Menu Principal','the_theme'));
});
// Enqueue and register scripts the right way.
add_action('wp_enqueue_scripts', function () {
wp_enqueue_style( 'the_theme-style', get_stylesheet_uri(), array());
});
// Remove JPEG compression.
add_filter('jpeg_quality', function () {
return 100;
}, 10, 2);
// Set custom excerpt more.
add_filter('excerpt_more', function () {
return '...';
});
// Set custom excerpt length.
add_filter('excerpt_length', function () {
return 101;
});