if ( ! isset( $content_width ) ) {
$content_width = 640; /* pixels */
}
/**
||-> hostcluster
*/
function hostcluster($redux_meta_name1,$redux_meta_name2 = ''){
global $hostcluster;
if (is_null($hostcluster)) {
return;
}
$html = '';
if (isset($redux_meta_name1) && !empty($redux_meta_name2)) {
$html = $hostcluster[$redux_meta_name1][$redux_meta_name2];
}elseif(isset($redux_meta_name1) && empty($redux_meta_name2)){
$html = $hostcluster[$redux_meta_name1];
}
return $html;
}
/**
||-> hostcluster_setup
*/
function hostcluster_setup() {
/*
* Make theme available for translation.
* Translations can be filed in the /languages/ directory.
* If you're building a theme based on hostcluster, use a find and replace
* to change 'hostcluster' to the name of your theme in all the template files
*/
load_theme_textdomain( 'hostcluster', get_template_directory() . '/languages' );
// This theme uses wp_nav_menu() in one location.
register_nav_menus( array(
'primary' => esc_html__( 'Primary menu', 'hostcluster' )
) );
// ADD THEME SUPPORT
add_theme_support( 'automatic-feed-links' );
add_theme_support( 'title-tag' );
add_theme_support( 'custom-header' );
add_theme_support( 'post-thumbnails' );
add_theme_support( 'html5', array(
'search-form', 'comment-form', 'comment-list', 'gallery', 'caption',
) );
remove_theme_support( 'widgets-block-editor' );
// Switch default core markup for search form, comment form, and comments to output valid HTML5.
// Enable support for Post Formats.
add_theme_support( 'custom-background', apply_filters( 'smartowl_custom_background_args', array(
'default-color' => 'ffffff',
'default-image' => '',
) ) );// Set up the WP core custom background feature.
}
add_action( 'after_setup_theme', 'hostcluster_setup' );
/**
||-> Register widget areas.
*/
function hostcluster_widgets_init() {
global $hostcluster;
register_sidebar( array(
'name' => esc_html__( 'Sidebar', 'hostcluster' ),
'id' => 'sidebar-1',
'description' => esc_html__( 'Main Theme Sidebar', 'hostcluster' ),
'before_widget' => '',
'before_title' => '
',
) );
if (!empty($hostcluster['mt_dynamic_sidebars'])){
foreach ($hostcluster['mt_dynamic_sidebars'] as &$value) {
$id = str_replace(' ', '', $value);
$id_lowercase = strtolower($id);
if ($id_lowercase) {
register_sidebar( array(
'name' => esc_attr($value),
'id' => esc_attr($id_lowercase),
'description' => esc_html__( 'Sidebar ', 'hostcluster' ) . esc_attr($value),
'before_widget' => '',
'before_title' => '',
) );
}
}
}
// FOOTER ROW 1
if (isset($hostcluster['mt_footer_row_1_layout'])) {
$footer_row_1 = $hostcluster['mt_footer_row_1_layout'];
$nr1 = array("1", "2", "3", "4", "5", "6");
if (in_array($footer_row_1, $nr1)) {
for ($i=1; $i <= $footer_row_1 ; $i++) {
register_sidebar( array(
'name' => esc_html__( 'Footer Row 1 - Sidebar ','hostcluster').esc_attr($i),
'id' => 'footer_row_1_'.esc_attr($i),
'description' => esc_html__( 'Footer Row 1 - Sidebar ', 'hostcluster' ) . esc_attr($i),
'before_widget' => '',
'before_title' => '',
) );
}
}elseif ($footer_row_1 == 'column_half_sub_half' || $footer_row_1 == 'column_sub_half_half') {
$footer_row_1 = '3';
for ($i=1; $i <= $footer_row_1 ; $i++) {
register_sidebar( array(
'name' => esc_html__( 'Footer Row 1 - Sidebar ', 'hostcluster' ) . esc_attr($i),
'id' => 'footer_row_1_'.esc_attr($i),
'description' => esc_html__( 'Footer Row 1 - Sidebar ', 'hostcluster' ) . esc_attr($i),
'before_widget' => '',
'before_title' => '',
) );
}
}elseif ($footer_row_1 == 'column_sub_fourth_third' || $footer_row_1 == 'column_third_sub_fourth') {
$footer_row_1 = '5';
for ($i=1; $i <= $footer_row_1 ; $i++) {
register_sidebar( array(
'name' => esc_html__( 'Footer Row 1 - Sidebar ','hostcluster').esc_attr($i),
'id' => 'footer_row_1_'.esc_attr($i),
'description' => esc_html__( 'Footer Row 1 - Sidebar ', 'hostcluster' ) . esc_attr($i),
'before_widget' => '',
'before_title' => '',
) );
}
}elseif ($footer_row_1 == 'column_sub_third_half' || $footer_row_1 == 'column_half_sub_third') {
$footer_row_1 = '4';
for ($i=1; $i <= $footer_row_1 ; $i++) {
register_sidebar( array(
'name' => esc_html__( 'Footer Row 1 - Sidebar ','hostcluster').esc_attr($i),
'id' => 'footer_row_1_'.esc_attr($i),
'description' => esc_html__( 'Footer Row 1 - Sidebar ', 'hostcluster' ) . esc_attr($i),
'before_widget' => '',
'before_title' => '',
) );
}
}
}
// FOOTER ROW 2
if (isset($hostcluster['mt_footer_row_2'])) {
$footer_row_2 = $hostcluster['mt_footer_row_2_layout'];
$nr2 = array("1", "2", "3", "4", "5", "6");
if (in_array($footer_row_2, $nr2)) {
for ($i=1; $i <= $footer_row_2 ; $i++) {
register_sidebar( array(
'name' => esc_html__( 'Footer Row 2 - Sidebar ','hostcluster').esc_attr($i),
'id' => 'footer_row_2_'.esc_attr($i),
'description' => esc_html__( 'Footer Row 2 - Sidebar ', 'hostcluster' ) . esc_attr($i),
'before_widget' => '',
'before_title' => '',
) );
}
}elseif ($footer_row_2 == 'column_half_sub_half' || $footer_row_2 == 'column_sub_half_half') {
$footer_row_2 = '3';
for ($i=1; $i <= $footer_row_2 ; $i++) {
register_sidebar( array(
'name' => esc_html__( 'Footer Row 2 - Sidebar ','hostcluster').esc_attr($i),
'id' => 'footer_row_2_'.esc_attr($i),
'description' => esc_html__( 'Footer Row 2 - Sidebar ', 'hostcluster' ) . esc_attr($i),
'before_widget' => '',
'before_title' => '',
) );
}
}elseif ($footer_row_2 == 'column_sub_fourth_third' || $footer_row_2 == 'column_third_sub_fourth') {
$footer_row_2 = '5';
for ($i=1; $i <= $footer_row_2 ; $i++) {
register_sidebar( array(
'name' => esc_html__( 'Footer Row 2 - Sidebar ','hostcluster').esc_attr($i),
'id' => 'footer_row_2_'.esc_attr($i),
'description' => esc_html__( 'Footer Row 2 - Sidebar ', 'hostcluster' ) . esc_attr($i),
'before_widget' => '',
'before_title' => '',
) );
}
}elseif ($footer_row_2 == 'column_sub_third_half' || $footer_row_2 == 'column_half_sub_third') {
$footer_row_2 = '4';
for ($i=1; $i <= $footer_row_2 ; $i++) {
register_sidebar( array(
'name' => esc_html__( 'Footer Row 2 - Sidebar ','hostcluster').esc_attr($i),
'id' => 'footer_row_2_'.esc_attr($i),
'description' => esc_html__( 'Footer Row 2 - Sidebar ', 'hostcluster' ) . esc_attr($i),
'before_widget' => '',
'before_title' => '',
) );
}
}
}
// FOOTER ROW 3
if (isset($hostcluster['mt_footer_row_3_layout'])) {
$footer_row_3 = $hostcluster['mt_footer_row_3_layout'];
$nr3 = array("1", "2", "3", "4", "5", "6");
if (in_array($footer_row_3, $nr3)) {
for ($i=1; $i <= $footer_row_3 ; $i++) {
register_sidebar( array(
'name' => esc_html__( 'Footer Row 3 - Sidebar ', 'hostcluster').esc_attr($i),
'id' => 'footer_row_3_'.esc_attr($i),
'description' => esc_html__( 'Footer Row 3 - Sidebar ', 'hostcluster' ) . esc_attr($i),
'before_widget' => '',
'before_title' => '',
) );
}
}elseif ($footer_row_3 == 'column_half_sub_half' || $footer_row_3 == 'column_sub_half_half') {
$footer_row_3 = '3';
for ($i=1; $i <= $footer_row_3 ; $i++) {
register_sidebar( array(
'name' => esc_html__( 'Footer Row 3 - Sidebar ','hostcluster').esc_attr($i),
'id' => 'footer_row_3_'.esc_attr($i),
'description' => esc_html__( 'Footer Row 3 - Sidebar ', 'hostcluster' ) . esc_attr($i),
'before_widget' => '',
'before_title' => '',
) );
}
}elseif ($footer_row_3 == 'column_sub_fourth_third' || $footer_row_3 == 'column_third_sub_fourth') {
$footer_row_3 = '5';
for ($i=1; $i <= $footer_row_3 ; $i++) {
register_sidebar( array(
'name' => esc_html__( 'Footer Row 3 - Sidebar ','hostcluster').esc_attr($i),
'id' => 'footer_row_3_'.esc_attr($i),
'description' => esc_html__( 'Footer Row 3 - Sidebar ', 'hostcluster' ) . esc_attr($i),
'before_widget' => '',
'before_title' => '',
) );
}
}elseif ($footer_row_3 == 'column_sub_third_half' || $footer_row_3 == 'column_half_sub_third') {
$footer_row_3 = '4';
for ($i=1; $i <= $footer_row_3 ; $i++) {
register_sidebar( array(
'name' => esc_html__( 'Footer Row 3 - Sidebar ','hostcluster').esc_attr($i),
'id' => 'footer_row_3_'.esc_attr($i),
'description' => esc_html__( 'Footer Row 3 - Sidebar ', 'hostcluster' ) . esc_attr($i),
'before_widget' => '',
'before_title' => '',
) );
}
}
}
}
add_action( 'widgets_init', 'hostcluster_widgets_init' );
/**
||-> Enqueue scripts and styles.
*/
function hostcluster_scripts() {
//STYLESHEETS
wp_enqueue_style( "font-awesome", get_template_directory_uri().'/css/font-awesome.min.css' );
wp_enqueue_style( "hostcluster-responsive", get_template_directory_uri().'/css/responsive.css' );
wp_enqueue_style( "hostcluster-media-screens", get_template_directory_uri().'/css/media-screens.css' );
wp_enqueue_style( "owl-carousel", get_template_directory_uri().'/css/owl.carousel.css' );
wp_enqueue_style( "animate", get_template_directory_uri().'/css/animate.css' );
wp_enqueue_style( "hostcluster-styles", get_template_directory_uri().'/css/styles.css' );
wp_enqueue_style( 'hostcluster-style', get_stylesheet_uri() );
wp_enqueue_style( "simple-line-icons", get_template_directory_uri().'/css/simple-line-icons.css' );
wp_enqueue_style( "js_composer", get_template_directory_uri().'/css/js_composer.css' );
wp_enqueue_style( "loaders", get_template_directory_uri().'/css/loaders.css' );
// Enqueue style if gutenberg is active
wp_enqueue_style( "hostcluster-gutenberg-frontend", get_template_directory_uri().'/css/gutenberg-frontend.css' );
//SCRIPTS
wp_enqueue_script( 'modernizr-custom', get_template_directory_uri() . '/js/modernizr.custom.js', array('jquery'), '2.6.2', true );
wp_enqueue_script( 'classie', get_template_directory_uri() . '/js/classie.js', array('jquery'), '1.0.0', true );
wp_enqueue_script( 'jquery-form', get_template_directory_uri() . '/js/jquery.form.js', array('jquery'), '3.51.0', true );
wp_enqueue_script( 'jquery-validation', get_template_directory_uri() . '/js/jquery.validation.js', array('jquery'), '1.13.1', true );
wp_enqueue_script( 'jquery-sticky', get_template_directory_uri() . '/js/jquery.sticky.js', array('jquery'), '1.0.0', true );
wp_enqueue_script( 'jquery.appear', get_template_directory_uri() . '/js/jquery.appear.js', array('jquery'), '1.0.0', true );
wp_enqueue_script( 'jquery.countTo', get_template_directory_uri() . '/js/jquery.countTo.js', array('jquery'), '1.0.0', true );
wp_enqueue_script( 'owl-carousel', get_template_directory_uri() . '/js/owl.carousel.js', array('jquery'), '1.0.0', true );
wp_enqueue_script( 'modernizr-viewport', get_template_directory_uri() . '/js/modernizr.viewport.js', array('jquery'), '2.6.2', true );
wp_enqueue_script( 'bootstrap', get_template_directory_uri() . '/js/bootstrap.min.js', array('jquery'), '3.3.1', true );
wp_enqueue_script( 'animate', get_template_directory_uri() . '/js/animate.js', array('jquery'), '1.0.0', true );
wp_enqueue_script( 'jquery-countdown', get_template_directory_uri() . '/js/jquery.countdown.js', array('jquery'), '1.0.0', true );
wp_enqueue_script( 'wow', get_template_directory_uri() . '/js/wow.min.js', array('jquery'), '1.0.0', true );
wp_enqueue_script( 'stickykit', get_template_directory_uri() . '/js/jquery.sticky-kit.min.js', array('jquery'), '1.0.0', true );
wp_enqueue_script( 'loaders', get_template_directory_uri() . '/js/loaders.js', array('jquery'), '1.0.0', true );
wp_enqueue_script( 'hostcluster-custom-js', get_template_directory_uri() . '/js/hostcluster-custom.js', array('jquery'), '1.0.0', true );
if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
wp_enqueue_script( 'comment-reply' );
}
}
add_action( 'wp_enqueue_scripts', 'hostcluster_scripts' );
/**
||-> Enqueue admin css/js
*/
function hostcluster_enqueue_admin_scripts( $hook ) {
// JS
wp_enqueue_script( "hostcluster_admin_scripts", get_template_directory_uri().'/js/hostcluster-admin-scripts.js' , array( 'jquery' ) );
wp_enqueue_script( "loaders", get_template_directory_uri().'/js/loaders.js' , array( 'jquery' ) );
// CSS
wp_enqueue_style( "hostcluster_admin_css", get_template_directory_uri().'/css/admin-style.css' );
wp_enqueue_style( "loaders", get_template_directory_uri().'/css/loaders.css' );
}
add_action('admin_enqueue_scripts', 'hostcluster_enqueue_admin_scripts');
/**
||-> Enqueue css to js_composer
*/
add_action( 'vc_base_register_front_css', 'hostcluster_enqueue_front_css_foreever' );
function hostcluster_enqueue_front_css_foreever() {
wp_enqueue_style( 'js_composer_front' );
}
/**
||-> Enqueue css to redux
*/
function hostcluster_register_fontawesome_to_redux() {
wp_register_style( 'font-awesome', get_template_directory_uri().'/css/font-awesome.min.css', array(), time(), 'all' );
wp_enqueue_style( 'font-awesome' );
}
add_action( 'redux/page/redux_demo/enqueue', 'hostcluster_register_fontawesome_to_redux' );
/**
||-> Force Visual Composer to initialize as "built into the theme". This will hide certain tabs under the Settings->Visual Composer page
*/
add_action( 'vc_before_init', 'hostcluster_vcSetAsTheme' );
function hostcluster_vcSetAsTheme() {
vc_set_as_theme( true );
}
/**
||-> Other required parts/files
*/
/* ========= LOAD CUSTOM FUNCTIONS ===================================== */
require_once get_template_directory() . '/inc/custom-functions.php';
require_once get_template_directory() . '/inc/custom-functions.header.php';
require_once get_template_directory() . '/inc/custom-functions.footer.php';
require_once get_template_directory() . '/inc/custom-functions.gutenberg.php';
/* ========= Customizer additions. ===================================== */
require_once get_template_directory() . '/inc/customizer.php';
/* ========= Load Jetpack compatibility file. ===================================== */
require_once get_template_directory() . '/inc/jetpack.php';
/* ========= Include the TGM_Plugin_Activation class. ===================================== */
require_once get_template_directory() . '/inc/tgm/include_plugins.php';
/* ========= LOAD - REDUX - FRAMEWORK ===================================== */
require_once get_template_directory() . '/redux-framework/modeltheme-config.php';
/* ========= CUSTOM COMMENTS ===================================== */
require_once get_template_directory() . '/inc/custom-comments.php';
/* ========= THEME DEFAULTS ===================================== */
require_once get_template_directory() . '/inc/theme-defaults.php';
/* ========= REQUIRE HELPERS ===================================== */
require_once get_template_directory() . '/inc/helpers.php';
/**
||-> add_image_size //Resize images
*/
/* ========= RESIZE IMAGES ===================================== */
add_image_size( 'hostcluster_related_post_pic500x300', 500, 300, true );
add_image_size( 'hostcluster_post_pic700x450', 700, 450, true );
add_image_size( 'hostcluster_post_widget_pic100x100', 100, 100, true );
add_image_size( 'hostcluster_about_625x415', 625, 415, true );
add_image_size( 'hostcluster_listing_archive_featured_square', 600, 370, true );
add_image_size( 'hostcluster_listing_archive_featured', 800, 500, true );
add_image_size( 'hostcluster_listing_archive_thumbnail', 300, 180, true );
add_image_size( 'hostcluster_listing_single_featured', 1200, 200, true );
// Blogloop-v2
add_image_size( 'hostcluster_blog_900x550', 900, 550, true );
/**
||-> LIMIT POST CONTENT
*/
function hostcluster_excerpt_limit($string, $word_limit) {
$words = explode(' ', $string, ($word_limit + 1));
if(count($words) > $word_limit) {
array_pop($words);
}
return implode(' ', $words);
}
/**
||-> BREADCRUMBS
*/
function hostcluster_breadcrumb() {
$delimiter = '';
$html = '';
$name = esc_html__("Home", "hostcluster");
$currentBefore = '';
$currentAfter = '';
if (!is_home() && !is_front_page() || is_paged()) {
global $post;
$home = esc_url(home_url('/'));
$html .= '' . esc_attr($name) . ' ' . esc_attr($delimiter) . '';
if (is_category()) {
global $wp_query;
$cat_obj = $wp_query->get_queried_object();
$thisCat = $cat_obj->term_id;
$thisCat = get_category($thisCat);
$parentCat = get_category($thisCat->parent);
if ($thisCat->parent != 0)
$html .= (get_category_parents($parentCat, true, '' . esc_attr($delimiter) . ''));
$html .= $currentBefore . single_cat_title('', false) . $currentAfter;
}elseif (is_tax()) {
global $wp_query;
$html .= $currentBefore . single_cat_title('', false) . $currentAfter;
} elseif (is_day()) {
$html .= '' . get_the_time('Y') . ' ' . esc_attr($delimiter) . '';
$html .= '' . get_the_time('F') . ' ' . esc_attr($delimiter) . ' ';
$html .= $currentBefore . get_the_time('d') . $currentAfter;
} elseif (is_month()) {
$html .= '' . get_the_time('Y') . ' ' . esc_attr($delimiter) . '';
$html .= $currentBefore . get_the_time('F') . $currentAfter;
} elseif (is_year()) {
$html .= $currentBefore . get_the_time('Y') . $currentAfter;
} elseif (is_attachment()) {
$html .= $currentBefore;
$html .= get_the_title();
$html .= $currentAfter;
} elseif (class_exists( 'WooCommerce' ) && is_shop()) {
$html .= $currentBefore;
$html .= esc_html__('Shop','hostcluster');
$html .= $currentAfter;
}elseif (class_exists( 'WooCommerce' ) && is_product()) {
global $post;
$cat = get_the_terms( $post->ID, 'product_cat' );
foreach ($cat as $categoria) {
if ($categoria) {
if($categoria->parent == 0){
// Get the ID of a given category
$category_id = get_cat_ID( $categoria->name );
// Get the URL of this category
$category_link = get_category_link( $category_id );
$html .= '' . esc_attr($categoria->name) . '';
$html .= esc_url($category_link);
}
}
}
$html .= $currentBefore;
$html .= get_the_title();
$html .= $currentAfter;
} elseif (is_single()) {
if (get_the_category()) {
$cat = get_the_category();
$cat = $cat[0];
$html .= '' . get_category_parents($cat, true, ' ' . esc_attr($delimiter) . '') . '';
}
$html .= $currentBefore;
$html .= get_the_title();
$html .= $currentAfter;
} elseif (is_page() && !$post->post_parent) {
$html .= $currentBefore;
$html .= get_the_title();
$html .= $currentAfter;
} elseif (is_page() && $post->post_parent) {
$parent_id = $post->post_parent;
$breadcrumbs = array();
while ($parent_id) {
$page = get_page($parent_id);
$breadcrumbs[] = '' . get_the_title($page->ID) . '';
$parent_id = $page->post_parent;
}
$breadcrumbs = array_reverse($breadcrumbs);
foreach ($breadcrumbs as $crumb)
$html .= $crumb . ' ' . esc_attr($delimiter) . ' ';
$html .= $currentBefore;
$html .= get_the_title();
$html .= $currentAfter;
} elseif (is_search()) {
$html .= $currentBefore . get_search_query() . $currentAfter;
} elseif (is_tag()) {
$html .= $currentBefore . single_tag_title( '', false ) . $currentAfter;
} elseif (is_author()) {
global $author;
$userdata = get_userdata($author);
$html .= $currentBefore . $userdata->display_name . $currentAfter;
} elseif (is_404()) {
$html .= $currentBefore . esc_html__('404 Not Found','hostcluster') . $currentAfter;
}
if (get_query_var('paged')) {
if (is_home() || is_category() || is_day() || is_month() || is_year() || is_search() || is_tag() || is_author())
$html .= $currentBefore;
$html .= esc_html__('Page','hostcluster') . ' ' . get_query_var('paged');
if (is_home() || is_category() || is_day() || is_month() || is_year() || is_search() || is_tag() || is_author())
$html .= $currentAfter;
}
}
return $html;
}
/**
||-> SEARCH FOR POSTS ONLY
*/
function hostcluster_search_filter($query) {
if ($query->is_search && !isset($_GET['post_type'])) {
if ( !function_exists('modeltheme_framework')) {
$query->set('post_type', 'post');
}else{
$query->set('post_type', 'post');
}
}
return $query;
}
add_filter('pre_get_posts','hostcluster_search_filter');
/**
||-> FUNCTION: ADD EDITOR STYLE
*/
function hostcluster_add_editor_styles() {
add_editor_style( 'css/custom-editor-style.css' );
}
add_action( 'admin_init', 'hostcluster_add_editor_styles' );
/**
||-> REMOVE PLUGINS NOTIFICATIONS and NOTICES
*/
// |---> REVOLUTION SLIDER
if(function_exists( 'set_revslider_as_theme' )){
add_action( 'init', 'hostcluster_disable_revslider_update_notices' );
function hostcluster_disable_revslider_update_notices() {
set_revslider_as_theme();
}
}
if ( class_exists( 'Vc_Manager' ) ) {
vc_disable_frontend();
}
?>
Page not found - Ariana Sabet Curative Hospital