Advertisement
Guenni007

footer

Jan 30th, 2023 (edited)
892
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 10.83 KB | None | 0 0
  1. <?php
  2. if( ! defined( 'ABSPATH' ) ) {  exit;  }    // Exit if accessed directly
  3.  
  4. /*
  5. * Please do not modify this file on your child theme to add scripts to Footer (before closing of Body tag) section.
  6. * Refer to this post - https://kriesi.at/documentation/enfold/add-custom-js-or-php-script/#add-a-script-to-footer-section and use functions.php file instead
  7. */
  8.  
  9. global $avia_config;
  10.  
  11.  
  12. /* new position of ending the main container   see lines 125 and  321 - 327 ********/
  13. ?>
  14. <!-- end main -->
  15. </div>
  16. <?php
  17.  
  18.         /**
  19.          * Fixes a bug started with WP 5.8.1
  20.          */
  21.          if( ! isset( $the_id ) )
  22.          {
  23.              $the_id = avia_get_the_id();
  24.          }
  25.  
  26.         /**
  27.          * Fired before footer output starts
  28.          *
  29.          * @since ???
  30.          */
  31.         do_action( 'ava_before_footer' );
  32.  
  33.         $blank = isset( $avia_config['template'] ) ? $avia_config['template'] : '';
  34.  
  35.         //  reset wordpress query in case we modified it
  36.         wp_reset_query();
  37.  
  38.         //  get link to previous and next post/portfolio entry
  39.         $avia_post_nav = avia_post_nav();
  40.  
  41.         //  set in header.php
  42.         $footer_option = $avia_config['footer_option'];
  43.  
  44.         if( 'nofooterarea' != $footer_option && 'curtain_footer' == $avia_config['footer_behavior'] )
  45.         {
  46.             $data = is_numeric( $avia_config['footer_media'] ) ? " data-footer_max_height='{$avia_config['footer_media']}'" : '';
  47.  
  48.             echo '<div class="av-curtain-footer-container"' . $data . '>';
  49.         }
  50.  
  51.         /**
  52.          * Fired after a possible footer container has been added and actual footer output starts
  53.          *
  54. .        * @since 4.8.6.3
  55.          */
  56.         do_action( 'ava_before_footer_output' );
  57.  
  58.         /*
  59.          * Check if we should display a page content as footer
  60.          */
  61.         if( ! $blank && in_array( $footer_option, array( 'page_in_footer_socket', 'page_in_footer' ) ) )
  62.         {
  63.             /**
  64.              * Allows 3rd parties to change page id's, e.g. translation plugins
  65.              */
  66.             $post = AviaCustomPages()->get_custom_page_object( 'footer_page', '' );
  67.  
  68.             if( ( $post instanceof WP_Post ) && ( $post->ID != $the_id ) )
  69.             {
  70.                 /**
  71.                  * Make sure that footerpage is set to fullwidth
  72.                  */
  73.                 $old_avia_config = $avia_config;
  74.  
  75.                 $avia_config['layout']['current'] = array(
  76.                                             'content'   => 'av-content-full alpha',
  77.                                             'sidebar'   => 'hidden',
  78.                                             'meta'      => '',
  79.                                             'entry'     => '',
  80.                                             'main'      => 'fullsize'
  81.                                         );
  82.  
  83.                 $builder_stat = ( 'active' == Avia_Builder()->get_alb_builder_status( $post->ID ) );
  84.                 $avia_config['conditionals']['is_builder'] = $builder_stat;
  85.                 $avia_config['conditionals']['is_builder_template'] = $builder_stat;
  86.  
  87.                 /**
  88.                  * @used_by         config-bbpress\config.php
  89.                  * @since 4.5.6.1
  90.                  * @param WP_Post $post
  91.                  * @param int $the_id
  92.                  */
  93.                 do_action( 'ava_before_page_in_footer_compile', $post, $the_id );
  94.  
  95.                 $content = Avia_Builder()->compile_post_content( $post );
  96.  
  97.                 /**
  98.                  * Remove leading <p> tag that is added by 'the_content' filter
  99.                  * https://kriesi.at/support/topic/small-gutenburg-issue/
  100.                  *
  101.                  * @since 4.8.8
  102.                  */
  103.                 $content = trim( $content );
  104.                 if( 0 === strpos( $content, '<p>' ) )
  105.                 {
  106.                     $content = substr( $content, 3 );
  107.                 }
  108.  
  109.                 $avia_config = $old_avia_config;
  110.  
  111.                 /**
  112.                  * @since 4.7.4.1
  113.                  * @param string
  114.                  * @param WP_Post $post
  115.                  * @param int $the_id
  116.                  */
  117.                 $extra_class = apply_filters( 'avf_page_as_footer_extra_classes', 'footer-page-content footer_color', $post, $the_id );
  118.  
  119.                 /**
  120.                  * Wrap footer page in case we need extra CSS changes
  121.                  *
  122.                  * @since 4.7.4.1
  123.                  */
  124.  
  125. // if page shows as footer and socket then:
  126.                 if( $footer_option == 'page_in_footer'){
  127.                     echo '<footer class="' . $extra_class . '" id="footer-page">';
  128.                     echo    $content;
  129.                     echo '</footer>';
  130.                 }
  131. // else
  132.                 else {
  133.                     echo '<div class="' . $extra_class . '" id="footer-page">';
  134.                     echo    $content;
  135.                     echo '</div>';
  136.                 }
  137.             }
  138.         }
  139.  
  140.         /**
  141.          * Check if we should display a footer
  142.          */
  143.         if( ! $blank && $footer_option != 'nofooterarea' )
  144.         {
  145.             if( in_array( $footer_option, array( 'all', 'nosocket' ) ) )
  146.             {
  147.                 //get columns
  148.                 $columns = avia_get_option('footer_columns');
  149.         ?>
  150.                 <div class='container_wrap footer_color' id='footer'>
  151.  
  152.                     <div class='container'>
  153.  
  154.                         <?php
  155.                         do_action('avia_before_footer_columns');
  156.  
  157.                         //create the footer columns by iterating
  158.                         switch( $columns )
  159.                         {
  160.                             case 1:
  161.                                 $class = '';
  162.                                 break;
  163.                             case 2:
  164.                                 $class = 'av_one_half';
  165.                                 break;
  166.                             case 3:
  167.                                 $class = 'av_one_third';
  168.                                 break;
  169.                             case 4:
  170.                                 $class = 'av_one_fourth';
  171.                                 break;
  172.                             case 5:
  173.                                 $class = 'av_one_fifth';
  174.                                 break;
  175.                             case 6:
  176.                                 $class = 'av_one_sixth';
  177.                                 break;
  178.                             default:
  179.                                 $class = '';
  180.                                 break;
  181.                         }
  182.  
  183.                         $firstCol = "first el_before_{$class}";
  184.  
  185.                         //display the footer widget that was defined at appearenace->widgets in the wordpress backend
  186.                         //if no widget is defined display a dummy widget, located at the bottom of includes/register-widget-area.php
  187.                         for( $i = 1; $i <= $columns; $i++ )
  188.                         {
  189.                             $class2 = ''; // initialized to avoid php notices
  190.                             if( $i != 1 )
  191.                             {
  192.                                 $class2 = " el_after_{$class} el_before_{$class}";
  193.                             }
  194.  
  195.                             echo "<div class='flex_column {$class} {$class2} {$firstCol}'>";
  196.  
  197.                             if( ! ( function_exists( 'dynamic_sidebar' ) && dynamic_sidebar( 'Footer - Column ' . $i ) ) )
  198.                             {
  199.                                 avia_dummy_widget( $i );
  200.                             }
  201.  
  202.                             echo '</div>';
  203.  
  204.                             $firstCol = '';
  205.                         }
  206.  
  207.                         do_action( 'avia_after_footer_columns' );
  208.  
  209.     ?>
  210.  
  211.                     </div>
  212.  
  213.                 <!-- ####### END FOOTER CONTAINER ####### -->
  214.                 </div>
  215.  
  216.     <?php   } //endif   array( 'all', 'nosocket' ) ?>
  217.  
  218.  
  219.     <?php
  220.  
  221.             //copyright
  222.             $copyright = do_shortcode( avia_get_option( 'copyright', '&copy; ' . __( 'Copyright', 'avia_framework' ) . "  - <a href='" . home_url( '/' ) . "'>" . get_bloginfo('name') . '</a>' ) );
  223.  
  224.             // you can filter and remove the backlink with an add_filter function
  225.             // from your themes (or child themes) functions.php file if you dont want to edit this file
  226.             // you can also remove the kriesi.at backlink by adding [nolink] to your custom copyright field in the admin area
  227.             // you can also just keep that link. I really do appreciate it ;)
  228.             $kriesi_at_backlink = kriesi_backlink( get_option( THEMENAMECLEAN . "_initial_version" ), 'Enfold' );
  229.  
  230.  
  231.             if( $copyright && strpos( $copyright, '[nolink]' ) !== false )
  232.             {
  233.                 $kriesi_at_backlink = '';
  234.                 $copyright = str_replace( '[nolink]', '', $copyright );
  235.             }
  236.  
  237.             /**
  238.              * @since 4.5.7.2
  239.              * @param string $copyright
  240.              * @param string $copyright_option
  241.              * @return string
  242.              */
  243.             $copyright_option = avia_get_option( 'copyright' );
  244.             $copyright = apply_filters( 'avf_copyright_info', $copyright, $copyright_option );
  245.  
  246.             if( in_array( $footer_option, array( 'all', 'nofooterwidgets', 'page_in_footer_socket' ) ) )
  247.             {
  248.  
  249.                 $aria_label = 'aria-label="' . __( 'Copyright and company info', 'avia_framework' ) . '"';
  250.  
  251.                 /**
  252.                  * @since 6.0.3
  253.                  * @param string $aria_label
  254.                  * @param string $context
  255.                  * @param mixed $additional_args
  256.                  * @return string
  257.                  */
  258.                 $aria_label = apply_filters( 'avf_aria_label_for_footer', $aria_label, __FILE__, null );
  259.  
  260.             ?>
  261.  
  262.                 <footer class='container_wrap socket_color' id='socket' <?php echo $aria_label . ' ' . avia_markup_helper( array( 'context' => 'footer' ) ); ?>>
  263.                     <div class='container'>
  264.  
  265.                         <span class='copyright'><?php echo $copyright . $kriesi_at_backlink; ?></span>
  266.  
  267.                         <?php
  268.                             if( avia_get_option( 'footer_social', 'disabled' ) != 'disabled' )
  269.                             {
  270.                                 $social_args = array( 'outside'=>'ul', 'inside'=>'li', 'append' => '' );
  271.                                 echo avia_social_media_icons( $social_args, false );
  272.                             }
  273.  
  274.                             $avia_theme_location = 'avia3';
  275.                             $avia_menu_class = $avia_theme_location . '-menu';
  276.  
  277.                             $args = array(
  278.                                         'theme_location'    => $avia_theme_location,
  279.                                         'menu_id'           => $avia_menu_class,
  280.                                         'container_class'   => $avia_menu_class,
  281.                                         'items_wrap'        => '<ul role="menu" class="%2$s" id="%1$s">%3$s</ul>',
  282.                                         'fallback_cb'       => '',
  283.                                         'depth'             => 1,
  284.                                         'echo'              => false,
  285.                                         'walker'            => new avia_responsive_mega_menu( array( 'megamenu' => 'disabled' ) )
  286.                                     );
  287.  
  288.                             $menu = wp_nav_menu( $args );
  289.  
  290.                             if( $menu )
  291.                             {
  292.                                 echo "<nav class='sub_menu_socket' " . avia_markup_helper( array( 'context' => 'nav', 'echo' => false ) ) . '>';
  293.                                 echo    $menu;
  294.                                 echo '</nav>';
  295.                             }
  296.                         ?>
  297.  
  298.                     </div>
  299.  
  300.                 <!-- ####### END SOCKET CONTAINER ####### -->
  301.                 </footer>
  302.  
  303.  
  304.             <?php
  305.             } //end nosocket check - array( 'all', 'nofooterwidgets', 'page_in_footer_socket' )
  306.  
  307.         } //end blank & nofooterarea check
  308.  
  309.         /**
  310.          * Fired before a possible footer container is closed
  311.          *
  312. .        * @since 4.8.6.3
  313.          */
  314.         do_action( 'ava_after_footer_output' );
  315.  
  316.         if( 'nofooterarea' != $footer_option && 'curtain_footer' == $avia_config['footer_behavior'] )
  317.         {
  318.             echo '</div>';  //  class="av-curtain-footer-container"
  319.         }
  320.  
  321. /*** original position of ending the main div ********
  322.         ?>
  323.         <!-- end main -->
  324.         </div>
  325.  
  326.         <?php
  327. *************************/
  328.  
  329.         /**
  330.          * Fired after footer container is closed
  331.          *
  332. .        * @since 4.8.6.3
  333.          */
  334.         do_action( 'ava_after_footer' );
  335.  
  336.         //display link to previous and next portfolio entry
  337.         echo    $avia_post_nav;
  338.  
  339.         echo "<!-- end wrap_all --></div>";
  340.  
  341.  
  342.         if( isset( $avia_config['fullscreen_image'] ) )
  343.         { ?>
  344.             <!--[if lte IE 8]>
  345.             <style type="text/css">
  346.             .bg_container {
  347.             -ms-filter:"progid:DXImageTransform.Microsoft.AlphaImageLoader(src='<?php echo $avia_config['fullscreen_image']; ?>', sizingMethod='scale')";
  348.             filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='<?php echo $avia_config['fullscreen_image']; ?>', sizingMethod='scale');
  349.             }
  350.             </style>
  351.             <![endif]-->
  352.         <?php
  353.             echo "<div class='bg_container' style='background-image:url(" . $avia_config['fullscreen_image'] . ");'></div>";
  354.         }
  355.     ?>
  356.  
  357.  
  358. <a href='#top' title='<?php _e( 'Scroll to top', 'avia_framework' ); ?>' id='scroll-top-link' <?php echo av_icon_string( 'scrolltop' ); ?> tabindex='-1'><span class="avia_hidden_link_text"><?php _e( 'Scroll to top', 'avia_framework' ); ?></span></a>
  359.  
  360. <div id="fb-root"></div>
  361.  
  362. <?php
  363.  
  364.     /* Always have wp_footer() just before the closing </body>
  365.      * tag of your theme, or you will break many plugins, which
  366.      * generally use this hook to reference JavaScript files.
  367.      */
  368.     wp_footer();
  369.  
  370. ?>
  371. </body>
  372. </html>
  373.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement