| Server IP : 82.208.35.60 / Your IP : 216.73.216.238 Web Server : Apache/2.4.55 (FreeBSD) OpenSSL/1.1.1q-freebsd PHP/7.3.31 System : FreeBSD server7.d2m.cz 12.4-RELEASE-p9 FreeBSD 12.4-RELEASE-p9 GENERIC amd64 User : studiokobylisy_cz ( 1008) PHP Version : 7.3.31 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /home/d2m/sofident_cz/wp-content/themes/sofident/ |
Upload File : |
<?php
/**
* Sofident functions and definitions
*
* @link https://developer.wordpress.org/themes/basics/theme-functions/
*
* @package Sofident
*/
if (!function_exists('sofident_setup')) :
function sofident_setup() {
load_theme_textdomain('sofident', get_template_directory() . '/languages');
add_theme_support('automatic-feed-links');
add_theme_support('title-tag');
add_theme_support('post-thumbnails');
// This theme uses wp_nav_menu() in one location.
register_nav_menus(array(
'menu-1' => esc_html__('Primary', 'sofident'),
'menu-2' => esc_html__('Footer', 'sofident'),
));
add_theme_support('html5', array(
'search-form',
'comment-form',
'comment-list',
'gallery',
'caption',
));
add_theme_support('custom-background', apply_filters('sofident_custom_background_args', array(
'default-color' => 'ffffff',
'default-image' => '',
)));
add_theme_support('customize-selective-refresh-widgets');
}
endif;
add_action('after_setup_theme', 'sofident_setup');
function sofident_content_width() {
$GLOBALS['content_width'] = apply_filters('sofident_content_width', 850);
}
add_action('after_setup_theme', 'sofident_content_width', 0);
function sofident_widgets_init() {
register_sidebar(array(
'name' => esc_html__('Sidebar', 'sofident'),
'id' => 'sidebar-1',
'description' => esc_html__('Add widgets here.', 'sofident'),
'before_widget' => '<section id="%1$s" class="widget %2$s">',
'after_widget' => '</section>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
));
}
add_action('widgets_init', 'sofident_widgets_init');
function sofident_scripts() {
wp_enqueue_style('sofident-style', get_stylesheet_uri());
wp_deregister_script('jquery');
wp_register_script('jquery', ("https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"), false, '2.1.4', false);
wp_enqueue_script('jquery');
wp_enqueue_script('sofident-vendor', get_template_directory_uri() . '/vendor.js', array(), '20151215', true);
wp_enqueue_script('sofident-dist', get_template_directory_uri() . '/scripts.js', array(), '20151215', true);
}
add_action('wp_enqueue_scripts', 'sofident_scripts');
require get_template_directory() . '/inc/custom-header.php';
require get_template_directory() . '/inc/template-tags.php';
require get_template_directory() . '/inc/extras.php';
require get_template_directory() . '/inc/jetpack.php';
require get_template_directory() . '/inc/custom-post-types.php';
require get_template_directory() . '/inc/acf-bidirection.php';
add_image_size( 'medium_large', '768', '0', false );
add_image_size( 'profile-photo', '100', '100', [ "center", "center" ] );
add_image_size( 'medium_large', '768', '0', false );
add_image_size( 'dentist', '300', '300', [ "center", "center" ] );
add_image_size( 'lazy', '24', '0', false );
if (function_exists('acf_add_options_page')) {
acf_add_options_page();
}
add_filter('show_admin_bar', '__return_false');
function cc_mime_types($mimes) {
$mimes['svg'] = 'image/svg+xml';
return $mimes;
}
add_filter('upload_mimes', 'cc_mime_types');
remove_action('wp_head', 'print_emoji_detection_script', 7);
remove_action('wp_print_styles', 'print_emoji_styles');
class ipage_submenu_class extends Walker_Nav_Menu {
function start_lvl(&$output, $depth = 0, $args = array()) {
$indent = str_repeat("\t", $depth);
$output .= "\n$indent<ul class=\"sub-menu-" . $depth . "\">\n";
}
}
function list_services($choices, $args = array()) {
// this function returns and array of label => value pairs to be used in the select field
$id = get_queried_object_id();
if (ICL_LANGUAGE_CODE == "cs") {
$choices = array('Vyberte službu' => '');
} elseif (ICL_LANGUAGE_CODE == "ru") {
$choices = array('Выберите услугу' => '');
} else {
$choices = array('Make a Selection' => '');
}
$args3 = array(
'posts_per_page' => -1,
'post_type' => 'service',
'tax_query' => array(
array(
'taxonomy' => 'department',
'field' => 'id',
'terms' => $id
)
)
);
$posts2 = get_posts($args3);
foreach ($posts2 as $post) : setup_postdata($post);
$choices[get_the_title($post->ID)] = get_the_title($post->ID);
endforeach;
wp_reset_postdata();
return $choices;
}
add_filter('cf_list_services', 'list_services', 10, 2);
add_filter('wpseo_breadcrumb_single_link', 'remove_services', 10, 2);
function remove_services($link_output, $link) {
if ($link['text'] == 'Services') {
$link_output = '';
}
return $link_output;
}
add_editor_style('style.css');
define('ICL_DONT_LOAD_LANGUAGE_SELECTOR_CSS', true);
add_action( 'wp_print_styles', 'wps_deregister_styles', 100 );
function wps_deregister_styles() {
wp_deregister_style( 'contact-form-7' );
}
function my_deregister_scripts(){
wp_deregister_script( 'wp-embed' );
}
add_action( 'wp_footer', 'my_deregister_scripts' );
function language_menu($class) {
echo '
<ul id="lang-switch" class="no-list ' . $class . '">
<li class="dropdown menu-item">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">' . strtoupper(ICL_LANGUAGE_CODE) . '</a><span class="caret"></span>
<ul class="dropdown-menu">';
$languages = icl_get_languages('skip_missing=0&orderby=code');
if (!empty($languages)) {
foreach ($languages as $l) {
echo ($l['active'] == 0 ? "<li><a href='" . $l['url'] . "'>" . strtoupper($l['language_code']) . "</a></li>" : NULL);
}
}
echo '
</ul>
</li>
</ul>
';
}
/**
* Remove the href from empty links `<a href="#">` in the nav menus
* @param string $menu the current menu HTML
* @return string the modified menu HTML
*/
function wpse_remove_empty_links($menu) {
return str_replace('<a href="#">', '<a>', $menu);
}
add_filter('wp_nav_menu_items', 'wpse_remove_empty_links');
remove_action('wp_head', 'print_emoji_detection_script', 7);
remove_action('wp_print_styles', 'print_emoji_styles');