| Server IP : 46.101.140.223 / Your IP : 216.73.216.134 Web Server : nginx/1.22.1 System : Linux debian-s-1vcpu-1gb-fra1-01 6.1.0-49-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.174-1 (2026-05-26) x86_64 User : deploy-others ( 1001) PHP Version : 8.2.32 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /home/deploy-others/projects/gulak.org.ua/wp-content/themes/scaffold/inc/ |
Upload File : |
<?php
/**
* Custom functions that act independently of the theme templates
*
* Eventually, some of the functionality here could be replaced by core features.
*
* @package scaffold
* @copyright Copyright (c) 2020, Danny Cooper
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
*/
/**
* Adds custom classes to the array of body classes.
*
* @param array $classes Classes for the body element.
* @return array
*/
function scaffold_body_classes( $classes ) {
// Adds a class of group-blog to blogs with more than 1 published author.
if ( is_multi_author() ) {
$classes[] = 'group-blog';
}
// Adds a class of hfeed to non-singular pages.
if ( ! is_singular() ) {
$classes[] = 'hfeed';
}
if ( ! is_post_type_archive() && ! comments_open() ) {
$classes[] = 'comments-closed';
}
return $classes;
}
add_filter( 'body_class', 'scaffold_body_classes' );
/**
* Add a pingback url auto-discovery header for singularly identifiable articles.
*/
function scaffold_pingback_header() {
if ( is_singular() && pings_open() ) {
echo '<link rel="pingback" href="', esc_url( get_bloginfo( 'pingback_url' ) ), '">';
}
}
add_action( 'wp_head', 'scaffold_pingback_header' );
/**
* Replaces the excerpt "Read More" text by a link.
*/
function new_excerpt_more() {
global $post;
return '… <p><a class="moretag" href="' . get_permalink( $post->ID ) . '">' . esc_html__( 'Read the full article', 'scaffold' ) . '</a></p>';
}
add_filter( 'excerpt_more', 'new_excerpt_more' );