Advertisement
Guenni007

footer

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