File: /home/mdosdorg/public_html/wp-content/themes/fundifly-charity/functions.php
<?php
if (!defined('FUNDIFLY_CHARITY_VERSION')) {
// Replace the version number of the theme on each release.
define('FUNDIFLY_CHARITY_VERSION', wp_get_theme()->get('Version'));
}
define('FUNDIFLY_CHARITY_DEBUG', defined('WP_DEBUG') && WP_DEBUG === true);
define('FUNDIFLY_CHARITY_DIR', trailingslashit(get_template_directory()));
define('FUNDIFLY_CHARITY_URL', trailingslashit(get_template_directory_uri()));
if (!function_exists('fundifly_support')) :
/**
* Sets up theme defaults and registers support for various WordPress features.
*
* @since walker_fse 1.0.0
*
* @return void
*/
function fundifly_support()
{
// Add default posts and comments RSS feed links to head.
add_theme_support('automatic-feed-links');
// Add support for block styles.
add_theme_support('wp-block-styles');
add_theme_support('post-thumbnails');
// Enqueue editor styles.
add_editor_style('style.css');
}
endif;
add_action('after_setup_theme', 'fundifly_support');
function fundifly_style()
{
wp_enqueue_style(
'fundifly-style',
get_stylesheet_uri(),
array(),
wp_get_theme()->get('Version')
);
}
add_action('wp_enqueue_scripts', 'fundifly_style');
/**
* Enqueue assets scripts for both backend and frontend
*/
function fundifly_block_style()
{
wp_enqueue_style('fundifly-block-style', get_template_directory_uri() . '/assets/css/block.css', array());
}
add_action('enqueue_block_assets', 'fundifly_block_style');
function fundifly_admin_style()
{
$hello_notice_current_screen = get_current_screen();
if (!empty($_GET['page']) && 'about-fundifly-charity' === $_GET['page'] || $hello_notice_current_screen->id === 'themes' || $hello_notice_current_screen->id === 'dashboard') {
wp_enqueue_style('fundifly-admin-style', get_template_directory_uri() . '/assets/css/admin-style.css', array(), FUNDIFLY_CHARITY_VERSION, 'all');
}
}
add_action('admin_enqueue_scripts', 'fundifly_admin_style');
/**
* Load core file.
*/
require_once get_template_directory() . '/inc/core/init.php';
/**
* Load welcome page file.
*/
require_once get_template_directory() . '/inc/admin/welcome-notice.php';
if (!function_exists('fundifly_excerpt_more_postfix')) {
function fundifly_excerpt_more_postfix($more)
{
if (is_admin()) {
return $more;
}
return '...';
}
add_filter('excerpt_more', 'fundifly_excerpt_more_postfix');
}