";
}
return $html;
}
function add_analytic_script()
{
if (redux_demo_get_option('analytics_top') && redux_demo_get_option('analytics_top') == true ) {
echo redux_demo_get_option( 'custom_analytic' );
} }
function aspace_show_sliderhome() {
if (redux_demo_get_option('active-slider') && redux_demo_get_option('active-slider') == 2 ) {
$slider_mainho = redux_demo_get_option('slider-main-template21');
echo do_shortcode($slider_mainho);
} }
function aspace_footer_sliderhome() {
if (redux_demo_get_option('active-slider') && redux_demo_get_option('active-slider') == 3 ) {
$slider_main = redux_demo_get_option('slider-main-template21');
echo do_shortcode($slider_main);
} }
function aspace_show_slidesingle() {
if (redux_demo_get_option('active-slider') && redux_demo_get_option('active-slider') == 2 ) {
$slider_mains = redux_demo_get_option('slider-main-template31');
echo do_shortcode($slider_mains);
} }
function aspace_footer_slidesingle() {
if (redux_demo_get_option('active-slider') && redux_demo_get_option('active-slider') == 3 ) {
$slider_msingle = redux_demo_get_option('slider-main-template31');
echo do_shortcode($slider_msingle);
} }
function aspace_fuulboxed_sliderpage() {
get_header('boxed');
if (redux_demo_get_option('active-slider') && redux_demo_get_option('active-slider') == 2 ) {
$slider_main = redux_demo_get_option('slider-main1');
echo do_shortcode($slider_main);
} }
function aspace_show_sliderpage() {
if (redux_demo_get_option('active-slider') && redux_demo_get_option('active-slider') == 2 ) {
$slider_main = redux_demo_get_option('slider-main1');
echo do_shortcode($slider_main);
} }
function slider_run() {
if ( function_exists('slide-anything') || is_plugin_active('slide-slider/slide-anything.php')) {
if (redux_demo_get_option('active-slider') && redux_demo_get_option('active-slider') == 2 ) {
$slider_main = redux_demo_get_option('slider-main-template11');
echo do_shortcode($slider_main);
} } }
function reate_slide() {
if (redux_demo_get_option('slider-header-on-meta') == true ) {
if (redux_demo_get_option('active-slider-meta') && redux_demo_get_option('active-slider-meta') == 2 ) {
$slider_main_meta = redux_demo_get_option('slider-main1-meta');
echo do_shortcode($slider_main_meta);
} }
}
function reate_fullboxedslide() {
get_header('boxed');
if (redux_demo_get_option('slider-header-on-meta') == true ) {
if (redux_demo_get_option('active-slider-meta') && redux_demo_get_option('active-slider-meta') == 2 ) {
$slider_main_ometa = redux_demo_get_option('slider-main1-meta');
echo do_shortcode($slider_main_ometa);
} }
}
function reate_slide_glo() {
if (redux_demo_get_option('slider-header-on') == true ) {
if (redux_demo_get_option('active-slider') && redux_demo_get_option('active-slider') == 2 ) {
$slider_main_1 = redux_demo_get_option('slider-main1');
echo do_shortcode($slider_main_1);
} }
}
function reate_slide_fullboxedglo() {
get_header('boxed');
if (redux_demo_get_option('slider-header-on') == true ) {
if (redux_demo_get_option('active-slider') && redux_demo_get_option('active-slider') == 2 ) {
$slider_main_2 = redux_demo_get_option('slider-main1');
echo do_shortcode($slider_main_2);
} }
}
// funcion page fullboxed mostrar slider com[paracion principal slider y slider metabox]
function slide_on_fullboxedglo() {
$slide_opt_glo = redux_demo_get_option('slider-header-on');
$slide_opt_int = redux_demo_get_option('slider-header-on-meta');
if ( $slide_opt_glo == true and $slide_opt_int == false ) {
echo reate_slide_fullboxedglo();
} elseif ( $slide_opt_glo == true and $slide_opt_int == true ) {
echo reate_fullboxedslide();
} else {
echo reate_fullboxedslide();
}
}
// funcion para paginas mostrar slider com[paracion principal slider y slider metabox]
function slide_on_glo() {
$slide_opt_glo = redux_demo_get_option('slider-header-on');
$slide_opt_int = redux_demo_get_option('slider-header-on-meta');
if ( $slide_opt_glo == true and $slide_opt_int == false ) {
echo reate_slide_glo();
} elseif ( $slide_opt_glo == true and $slide_opt_int == true ) {
echo reate_slide();
} else {
echo reate_slide();
}
}
function reate_slide_footer() {
if (redux_demo_get_option('slider-header-on-meta') == true ) {
if (redux_demo_get_option('active-slider-meta') && redux_demo_get_option('active-slider-meta') == 3 ) {
$slider_main_meta = redux_demo_get_option('slider-main1-meta');
echo do_shortcode($slider_main_meta);
} }
}
add_filter('term_links-post_tag','limitar_tags');
function limitar_tags($terms) {
return array_slice($terms,0,5,true);
}
function get_btn_login_topbar() {
$claseaspace = new Aspace_Login();
$claseaspace -> login_topbar_notice_content();
$claseaspace -> login_topbar_styles_and_scripts();
}
add_action('topbar_login', 'get_btn_login_topbar');
function aspace_hover_image_single() {
$img_hoveraspace = new Aspace_Img_Hover_Single();
$img_hoveraspace -> img_hover_notice_content();
$img_hoveraspace -> img_hover_styles_and_scripts();
}
add_action('img_hover_singles', 'aspace_hover_image_single');
function aspace_hover_image_blog() {
$img_hoveraspace = new Aspace_Img_Hover_Blog();
$img_hoveraspace -> img_hover1_notice_content();
$img_hoveraspace -> img_hover1_styles_and_scripts();
}
add_action('img_hover_blogs', 'aspace_hover_image_blog');
function aspace_hover_image_blog3() {
$img_hoveraspace = new Aspace_Img_Hover_Blog3();
$img_hoveraspace -> img_hover3_notice_content();
$img_hoveraspace -> img_hover3_styles_and_scripts();
}
add_action('img_hover_blog3', 'aspace_hover_image_blog3');
function aspace_hover_image_blog4() {
$img_hoveraspace = new Aspace_Img_Hover_Blog4();
$img_hoveraspace -> img_hover4_notice_content();
$img_hoveraspace -> img_hover4_styles_and_scripts();
}
add_action('img_hover_blog3', 'aspace_hover_image_blog4');
function aspace_hover_image_blog5() {
$img_hoveraspace = new Aspace_Img_Hover_Blog5();
$img_hoveraspace -> img_hover5_notice_content();
$img_hoveraspace -> img_hover5_styles_and_scripts();
}
add_action('img_hover_blog3', 'aspace_hover_image_blog4');
function get_btn_login_footer() {
$claseaspace = new Aspace_Footer_Login();
$claseaspace -> bmi_notice_content_footer();
}
add_action('footer_login', 'get_btn_login_footer');
function aut_search_form()
{
require get_template_directory() . '/searchform-top.php';
}
function aut_search_form_footer()
{
require get_template_directory() . '/searchform-bottom.php';
}
function wpdc_enable_gutenberg_custom_spacing() {
add_theme_support( 'custom-spacing' );
}
add_action( 'after_setup_theme', 'wpdc_enable_gutenberg_custom_spacing' );
if ( function_exists( 'register_block_pattern_category' ) ) {
register_block_pattern_category(
'aspace',
array( 'label' => esc_html__( 'Aspace Pattern', 'aspace' ) )
);
}
function aspace_get_pattern_content( $template_path ) {
ob_start();
get_template_part( $template_path );
$pattern_content = ob_get_contents();
ob_end_clean();
return $pattern_content;
}
$pattern_overlapping = aspace_get_pattern_content('template-parts/pattern/overlapping-img');
register_block_pattern(
'aspace/overlapping-images',
[
'title' => esc_html__( 'Overlapping images', 'aspace' ),
'categories' => array( 'aspace' ),
'viewportWidth' => 1024,
'description' => esc_html_x( 'Three images inside an overlapping columns block.', 'Block pattern description', 'aspace' ),
'content' => $pattern_overlapping,
]
);
//$pattern_cover = aspace_get_pattern_content('template-parts/pattern/cover');
$pattern_tabs = aspace_get_pattern_content('template-parts/pattern/tabs');
register_block_pattern(
'aspace/tabs-presentation-work',
[
'title' => esc_html__( 'Tabs with some presentation info', 'aspace' ),
'categories' => array( 'aspace' ),
'viewportWidth' => 1024,
'description' => esc_html_x( 'Tabs with some info.', 'Block pattern description', 'aspace' ),
'content' => $pattern_tabs,
]
);
$pattern_cover = aspace_get_pattern_content('template-parts/pattern/cover');
register_block_pattern(
'aspace/cover-heading-text-button',
[
'title' => esc_html__( 'Cover with heading, paragraph, and button', 'aspace' ),
'categories' => array( 'aspace' ),
'viewportWidth' => 1024,
'description' => esc_html_x( 'Nice cover with heading, paragraph, and button.', 'Block pattern description', 'aspace' ),
'content' => $pattern_cover,
]
);
$pattern_two_column = aspace_get_pattern_content('template-parts/pattern/two-column');
register_block_pattern(
'aspace/two-column-button',
[
'title' => esc_html__( 'Two column, heading, paragraph, and button', 'aspace' ),
'categories' => array( 'aspace' ),
'viewportWidth' => 1024,
'description' => esc_html_x( 'Two column, heading, paragraph, and button.', 'Block pattern description', 'aspace' ),
'content' => $pattern_two_column,
]
);
$pattern_cover_two_column = aspace_get_pattern_content('template-parts/pattern/cover-two-column');
register_block_pattern(
'aspace/cover-two-column',
[
'title' => esc_html__( 'Cover with two column, heading, paragraph, and button', 'aspace' ),
'categories' => array( 'aspace' ),
'viewportWidth' => 1024,
'description' => esc_html_x( 'Cover with two column, heading, paragraph, and button', 'Block pattern description', 'aspace' ),
'content' => $pattern_cover_two_column,
]
);
$pattern_three_cover = aspace_get_pattern_content('template-parts/pattern/three-cover');
register_block_pattern(
'aspace/three-cover',
[
'title' => esc_html__( 'Three covers with images ang parallax style', 'aspace' ),
'categories' => array( 'aspace' ),
'viewportWidth' => 1024,
'description' => esc_html_x( 'Covers parallax style with two column, heading, paragraph, and button', 'Block pattern description', 'aspace' ),
'content' => $pattern_three_cover,
]
);
$pattern_cta = aspace_get_pattern_content('template-parts/pattern/cta');
register_block_pattern(
'aspace/cta',
[
'title' => esc_html__( 'Cta', 'aspace' ),
'categories' => array( 'aspace' ),
'viewportWidth' => 1024,
'description' => esc_html_x( 'Cta with heading and button', 'Block pattern description', 'aspace' ),
'content' => $pattern_cta,
]
);
$pattern_cta_two_col = aspace_get_pattern_content('template-parts/pattern/cta-two-column');
register_block_pattern(
'aspace/cta-two-column',
[
'title' => esc_html__( 'Cta two column', 'aspace' ),
'categories' => array( 'aspace' ),
'viewportWidth' => 1024,
'description' => esc_html_x( 'Covers parallax style with two column, heading, paragraph, and button', 'Block pattern description', 'aspace' ),
'content' => $pattern_cta_two_col,
]
);
$pattern_cta_gradient = aspace_get_pattern_content('template-parts/pattern/cta-gradient');
register_block_pattern(
'aspace/cta-gradient',
[
'title' => esc_html__( 'Cta gradient one column', 'aspace' ),
'categories' => array( 'aspace' ),
'viewportWidth' => 1024,
'description' => esc_html_x( 'Covers parallax style with two column, heading, paragraph, and button', 'Block pattern description', 'aspace' ),
'content' => $pattern_cta_gradient,
]
);
$pattern_cta_gradient_heading = aspace_get_pattern_content('template-parts/pattern/cta-gradient-heading');
register_block_pattern(
'aspace/cta-gradient-heading',
[
'title' => esc_html__( 'Cta gradient two columns', 'aspace' ),
'categories' => array( 'aspace' ),
'viewportWidth' => 1024,
'description' => esc_html_x( 'Covers parallax style with two column, heading, paragraph, and button', 'Block pattern description', 'aspace' ),
'content' => $pattern_cta_gradient_heading,
]
);
$pattern_cover_three_column = aspace_get_pattern_content('template-parts/pattern/cover-three-column');
register_block_pattern(
'aspace/cover-three-column',
[
'title' => esc_html__( 'Cta gradient and images overlapping', 'aspace' ),
'categories' => array( 'aspace' ),
'viewportWidth' => 1024,
'description' => esc_html_x( 'Covers parallax style with two column, heading, paragraph, and button', 'Block pattern description', 'aspace' ),
'content' => $pattern_cover_three_column,
]
);
$pattern_add = aspace_get_pattern_content('template-parts/pattern/add');
register_block_pattern(
'aspace/cover-three-column-paragraph',
[
'title' => esc_html__( 'Three Cover with three columns', 'aspace' ),
'categories' => array( 'aspace' ),
'viewportWidth' => 1024,
'description' => esc_html_x( 'Three Cover with three columns with button', 'Block pattern description', 'aspace' ),
'content' => $pattern_add,
]
);
function redux_plugin_check() {
$plugin__deactivate = 'aspace-options/aspace-options.php';
if(!function_exists('redux_plugin_check')){
require_once ABSPATH . 'wp-admin/includes/plugin.php';
}
if(!is_plugin_active($plugin__deactivate)){
$url = get_template_part('template-parts/button/subscribe');
wp_redirect($url);
exit();
}
}
function aspace_escape_svg() {
$kses_defaults = wp_kses_allowed_html( 'post' );
$rich_text_that_might_include_SVGs = '';
$svg_args = array(
'svg' => array(
'class' => true,
'aria-hidden' => true,
'aria-labelledby' => true,
'role' => true,
'xmlns' => true,
'width' => true,
'height' => true,
'viewbox' => true, // <= Must be lower case!
),
'g' => array( 'fill' => true ),
'title' => array( 'title' => true ),
'path' => array( 'd' => true, 'fill' => true, ),
);
$allowed_tags = array_merge( $kses_defaults, $svg_args );
echo wp_kses( $rich_text_that_might_include_SVGs, $allowed_tags );
return $rich_text_that_might_include_SVGs;
}
add_action('escape_svg', 'aspace_escape_svg');
function limit_string_on_posts(){
// strip tags to avoid breaking any html
$string = strip_tags($string);
if (strlen($string) > 500) {
// truncate string
$stringCut = substr($string, 0, 500);
$endPoint = strrpos($stringCut, ' ');
//if the string doesn't contain any space then it will cut without word basis.
$string = $endPoint? substr($stringCut, 0, $endPoint) : substr($stringCut, 0);
$string .= '... Read More';
}
echo $string;
}
add_action('new_string_on_posts', 'limit_string_on_posts');
/* custom metaboxes */
//function execute_metaboxes(){
// Predefined custom fields for Homepage Slides
/* $key_homepage_slide = "_udt_homepage_slide_meta";
$meta_boxes_homepage_slide = array(
"caption_style" => array(
"name" => "caption_style",
"title" => "Caption Style",
"description" => 'Select the caption style you would like to use with this slide.'
)
);
function create_homepage_slide_meta_box() {
global $key_homepage_slide;
if( function_exists( 'add_meta_box' ) ) {
add_meta_box( 'new-meta-boxes', __('Slide Options','ego'), 'display_homepage_slide_meta_box', 'udt_homepage_slider', 'normal', 'high');
}
}
function display_homepage_slide_meta_box() {
global $post, $meta_boxes_homepage_slide, $key_homepage_slide;
?>
ID, $key_homepage_slide, true);
?>
array(
"name" => "caption_style",
"title" => "Caption Style",
"description" => 'Select the caption style you would like to use with this price.'
)
);
function create_ads_price_meta_box() {
global $key_ads_price;
if( function_exists( 'add_meta_box' ) ) {
add_meta_box( 'new-meta-boxes', __('price Options','ego'), 'display_ads_price_meta_box', 'udt_homepage_pricer', 'normal', 'high');
}
}
function display_ads_price_meta_box() {
global $post, $meta_boxes_homepage_price, $key_ads_price;
?>