Advertisement
Guenni007

footer

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