0){ foreach ($scriptComponent as $key => $value) { if ( empty( $data['amp_component_scripts'][$key] ) ) { $data['amp_component_scripts'][$key] = $value; } } } return $data; } //Component Loader function add_amp_theme_support($componentName){ global $wpdb; global $loadComponent,$supportComponent; if($supportComponent){ if(in_array($componentName, $supportComponent)){ $loadComponent[$componentName] = true; ampforwp_loadComponents($componentName); return true; } } return false; } //Include the Component file function ampforwp_loadComponents($componentName){ global $wpdb; if(empty($componentName)) return ''; $componentName = str_replace("AMP-", "", $componentName); $file = AMP_FRAMEWORK_COMOPNENT_DIR_PATH.'/'.$componentName.'/'.$componentName.".php"; if(!file_exists($file)){ return ''; } include_once($file); } // Icons $amp_icons_css = array(); function add_amp_icon($args=array()){ global $amp_icons_css, $redux_builder_amp; $amp_icons_css_array = include AMPFORWP_PLUGIN_DIR .'includes/icons/amp-icons.php'; foreach ($args as $key ) { if(isset($amp_icons_css_array[$key])) $amp_icons_css[$key] = $amp_icons_css_array[$key]; } // Design-1,2,3 if ( 1 == $redux_builder_amp['amp-design-selector'] || 2 == $redux_builder_amp['amp-design-selector'] || 3 == $redux_builder_amp['amp-design-selector'] ) { add_action('amp_post_template_css', 'amp_icon_css',999); } else add_action('amp_css', 'amp_icon_css'); } function amp_icon_css(){ global $amp_icons_css, $redux_builder_amp; foreach ($amp_icons_css as $key => $value) { // TODO: https://github.com/ahmedkaludi/accelerated-mobile-pages/issues/2651 echo $value; } // Add @font-face for Design-1,2,3 if ( 1 == $redux_builder_amp['amp-design-selector'] || 2 == $redux_builder_amp['amp-design-selector'] || 3 == $redux_builder_amp['amp-design-selector'] ) { ?> @font-face {font-family: 'icomoon';font-style: normal;font-weight: normal;font-display: swap;src: local('icomoon'), local('icomoon'), url('icomoon/icomoon.ttf');} [class^="icon-"], [class*=" icon-"] {font-family: 'icomoon';speak: none;font-style: normal;font-weight: normal;font-variant: normal;text-transform: none;line-height: 1;-webkit-font-smoothing: antialiased;-moz-osx-font-smoothing: grayscale;} ID; if( $ID!=null ){ do_action('ampforwp_above_the_title'); ?>

ID; if ( $post_id != null && true == $redux_builder_amp['enable-excerpt-single'] ) { ?>

get( 'html_tag_attributes' ) ); $bodyClass = ''; if ( is_single() || is_page() ) { $bodyClass = 'single-post'; $bodyClass .= ( is_page()? ' amp-single-page ' : ' amp-single '); } // Archive if ( is_archive() ) { $bodyClass = 'amp-archive'; } $ampforwp_custom_post_page = ampforwp_custom_post_page(); add_action('amp_post_template_head','ampforwp_sanitize_archive_desc'); function ampforwp_sanitize_archive_desc(){ $description = get_the_archive_description(); if ($description) { $sanitizer = new AMPFORWP_Content( $description, array(), apply_filters( 'ampforwp_content_sanitizers', array( 'AMP_Style_Sanitizer' => array(), 'AMP_Blacklist_Sanitizer' => array(), 'AMP_Img_Sanitizer' => array(), 'AMP_Video_Sanitizer' => array(), 'AMP_Audio_Sanitizer' => array(), 'AMP_Iframe_Sanitizer' => array( 'add_placeholder' => true, ) ) ) ); $amp_component_scripts = $sanitizer->amp_scripts; if ( $sanitizer && $amp_component_scripts) { foreach ($amp_component_scripts as $ampforwp_service => $ampforwp_js_file) { ?> get( 'body_class' ) ); if ($redux_builder_amp['amp-frontpage-select-option'] == 1) { $bodyClass = 'single-post design_3_wrapper'; } if ( $ampforwp_custom_post_page == "page" && ampforwp_name_blog_page() ) { $current_url = home_url( $GLOBALS['wp']->request ); $current_url_in_pieces = explode( '/', $current_url ); if( in_array( ampforwp_name_blog_page() , $current_url_in_pieces ) ) { $bodyClass = 'amp-index' .esc_attr( $thisTemplate->get( 'body_class' ) ); } } } // is_search if ( is_search() ) { $bodyClass = 'amp_home_body archives_body design_3_wrapper'; } if( true == $redux_builder_amp['amp-rtl-select-option'] ){ $bodyClass .= ' rtl '; } ?> get( 'html_tag_attributes' ) ); ?>> '; wp_head(); }else{ if(is_search()){?> > load_parts( array( 'header' ) ); do_action( 'amp_after_header', $thisTemplate ); do_action( 'ampforwp_after_header', $thisTemplate ); do_action('ampforwp_post_before_design_elements') ?> load_parts( array( 'footer' ) ); } function amp_footer_core(){ global $ampforwpTemplate; $post_id = get_queried_object_id(); if ( ampforwp_polylang_front_page() ) { $post_id = pll_get_post(get_option('page_on_front')); } $thisTemplate = $ampforwpTemplate; if(ampforwp_amp_nonamp_convert("", "check")){ wp_footer(); } else { do_action( 'amp_post_template_footer', $thisTemplate ); do_action('ampforwp_global_after_footer'); do_action('amp_end',$thisTemplate); } amp_back_to_top_link(); // Close the body and Html tags ?>
    1. '; global $redux_builder_amp; echo '' . strip_tags(ampforwp_translation($redux_builder_amp['amp-translator-footer-text'],'All Rights Reserved'),$allowed_tags) . '' ; if($redux_builder_amp['amp-footer-link-non-amp-page']=='1') { ampforwp_view_nonamp(); } } // Back to Top function amp_back_to_top_link(){ global $redux_builder_amp; if(true == ampforwp_get_setting('ampforwp-footer-top')){?> load_parts( array( 'loop' ) ); do_action('amp_after_loop',$thisTemplate); } // The Content function amp_content($post_id= ''){ global $redux_builder_amp, $post, $ampforwpTemplate; if ( empty( $post_id )) { $post_id = get_queried_object_id(); if ( ampforwp_is_front_page() ) { $post_id = ampforwp_get_frontpage_id(); } elseif ( ampforwp_polylang_front_page() ) { $post_id = pll_get_post(get_option('page_on_front')); } } $thisTemplate = $ampforwpTemplate; if ( 1 == ampforwp_get_setting('amp-design-selector') ) { do_action('ampforwp_inside_post_content_before',$thisTemplate); } else{ do_action('ampforwp_before_post_content',$thisTemplate); } $amp_custom_content_enable = get_post_meta( $thisTemplate->get( 'post_id' ) , 'ampforwp_custom_content_editor_checkbox', true); // Normal Content if ( ! $amp_custom_content_enable ) { $ampforwp_the_content = $thisTemplate->get( 'post_amp_content' ); // amphtml content; no kses } else { // Custom/Alternative AMP content added through post meta $ampforwp_the_content = $thisTemplate->get( 'ampforwp_amp_content' ); } // Muffin Builder Compatibility #1455 #1893 if ( function_exists('mfn_builder_print') && ! $amp_custom_content_enable ) { ob_start(); mfn_builder_print( $thisTemplate->get( 'post_id' ) ); $content = ob_get_contents(); ob_end_clean(); $sanitizer_obj = new AMPFORWP_Content( $content, array(), apply_filters( 'ampforwp_content_sanitizers', array( 'AMP_Img_Sanitizer' => array(), 'AMP_Blacklist_Sanitizer' => array(), 'AMP_Style_Sanitizer' => array(), 'AMP_Video_Sanitizer' => array(), 'AMP_Audio_Sanitizer' => array(), 'AMP_Iframe_Sanitizer' => array( 'add_placeholder' => true, ), ) ) ); if ( ! get_post_meta( $post_id, 'mfn-post-hide-content', true ) && ampforwp_is_front_page() ) { $ampforwp_custom_amp_editor_content = ''; $ampforwp_custom_amp_editor_content = $ampforwp_the_content; $ampforwp_the_content = $sanitizer_obj->get_amp_content(); $ampforwp_the_content .= $ampforwp_custom_amp_editor_content; } else{ $ampforwp_the_content = $sanitizer_obj->get_amp_content(); } } $ampforwp_the_content = apply_filters('ampforwp_modify_the_content',$ampforwp_the_content); echo $ampforwp_the_content; // amphtml content, no kses do_action('ampforwp_after_post_content',$thisTemplate); } function amp_date( $args=array() ) { global $redux_builder_amp; if ( 2 == $redux_builder_amp['ampforwp-post-date-format'] ) { $args = array('format' => 'traditional'); } if ( (isset($args['format']) && $args['format'] == 'traditional') || 'time' == $args ) { $post_date = get_the_date() . ' '. get_the_time(); } else { $post_date = human_time_diff( get_the_time('U', get_the_ID() ), current_time('timestamp') ) .' '. ampforwp_translation( $redux_builder_amp['amp-translator-ago-date-text'], 'ago'); } $post_date = apply_filters('ampforwp_modify_post_date', $post_date); if(isset($args['custom_format']) && $args['custom_format']!=""){ $post_date = date($args['custom_format'],get_the_time('U', get_the_ID() )); } if ( 'date' == $args || 'time' == $args ) { echo esc_attr($post_date) .' '; } else echo '
      '.esc_attr($post_date).'
      '; } //Load font Compoment $fontComponent = array(); function amp_post_load_custom_fonts(){ global $fontComponent; if(count($fontComponent)){ $fontComponent = array_unique($fontComponent); foreach ($fontComponent as $key => $value) { ?> body.rtl {direction: rtl;} body amp-carousel{ direction: ltr;} post_author); $author_link = get_author_posts_url($post_author->ID); if ( $author_name ) { echo ' ' .esc_html( $post_author->display_name ).''; } if ( $avatar && true == ampforwp_gravatar_checker($post_author->user_email) ) { $author_avatar_url = get_avatar_url( $post_author->ID, array( 'size' => $avatar_size ) ); ?> data-block-on-consent src="" width="" height="" layout="fixed"> user_email ) ) { $avatar_img = get_avatar( $post_author->user_email, $avatar_size ); $amp_html_sanitizer = new AMPFORWP_Content( $avatar_img, array(), apply_filters( 'ampforwp_content_sanitizers', array( 'AMP_Img_Sanitizer' => array() ) ) ); $amp_html = $amp_html_sanitizer->get_amp_content(); echo $amp_html; // amphtml content, no kses } } // amp-animation CSS #2819 add_action('amp_post_template_css','ampforwp_backtotop_global_css'); function ampforwp_backtotop_global_css(){ if( true == ampforwp_get_setting('ampforwp-footer-top') ) { ?> .btt{ position: fixed; bottom: 55px; bottom: 20px; right: 20px; background: rgba(71, 71, 71, 0.5); color: #fff; border-radius: 100%; width: 50px; height: 50px; } .btt:hover{color:#fff;background:#474747;} .btt:before{ content: '\25be'; display: block; font-size: 35px; font-weight: 600; color: #fff; transform: rotate(180deg); text-align: center; line-height: 1.5; } '; } else{ $amp_addthis = ''; } do_action('ampforwp_before_social_icons_hook'); return $amp_addthis; do_action('ampforwp_after_social_icons_hook'); } } }