Advertisement
Guenni007

footer

Aug 5th, 2020
1,896
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 9.57 KB | None | 0 0
  1.        
  2.         <!-- additional Container (#distance) as replacement for the gap -->
  3.         <div id="distance"></div>  
  4.  
  5.         <!-- end main -->
  6.         </div>
  7.  
  8.         <?php
  9.        
  10.         if ( ! defined( 'ABSPATH' ) ) {  exit;  }    // Exit if accessed directly
  11.            
  12.        
  13.         do_action( 'ava_before_footer' );  
  14.            
  15.         global $avia_config;
  16.         $blank = isset( $avia_config['template'] ) ? $avia_config['template'] : '';
  17.  
  18.         //reset wordpress query in case we modified it
  19.         wp_reset_query();
  20.  
  21.  
  22.         //get footer display settings
  23.         $the_id = avia_get_the_id(); //use avia get the id instead of default get id. prevents notice on 404 pages
  24.         $footer = get_post_meta( $the_id, 'footer', true );
  25.         $footer_options = avia_get_option( 'display_widgets_socket', 'all' );
  26.        
  27.         //get link to previous and next post/portfolio entry
  28.         $avia_post_nav = avia_post_nav();
  29.  
  30.         /**
  31.          * Reset individual page override to defaults if widget or page settings are different (user might have changed theme options)
  32.          * (if user wants a page as footer he must select this in main options - on individual page it's only possible to hide the page)
  33.          */
  34.         if( false !== strpos( $footer_options, 'page' ) )
  35.         {
  36.             /**
  37.              * User selected a page as footer in main options
  38.              */
  39.             if( ! in_array( $footer, array( 'page_in_footer_socket', 'page_in_footer', 'nofooterarea' ) ) )
  40.             {
  41.                 $footer = '';
  42.             }
  43.         }
  44.         else
  45.         {
  46.             /**
  47.              * User selected a widget based footer in main options
  48.              */
  49.             if( in_array( $footer, array( 'page_in_footer_socket', 'page_in_footer' ) ) )
  50.             {
  51.                 $footer = '';
  52.             }
  53.         }
  54.        
  55.         $footer_widget_setting  = ! empty( $footer ) ? $footer : $footer_options;
  56.  
  57.         /*
  58.          * Check if we should display a page content as footer
  59.          */
  60.         if( ! $blank && in_array( $footer_widget_setting, array( 'page_in_footer_socket', 'page_in_footer' ) ) )
  61.         {
  62.             /**
  63.              * Allows 3rd parties to change page id's, e.g. translation plugins
  64.              */
  65.             $post = AviaCustomPages()->get_custom_page_object( 'footer_page', '' );
  66.            
  67.             if( ( $post instanceof WP_Post ) && ( $post->ID != $the_id ) )
  68.             {
  69.                 /**
  70.                  * Make sure that footerpage is set to fullwidth
  71.                  */
  72.                 $old_avia_config = $avia_config;
  73.                
  74.                 $avia_config['layout']['current'] = array(
  75.                                             'content'   => 'av-content-full alpha',
  76.                                             'sidebar'   => 'hidden',
  77.                                             'meta'      => '',
  78.                                             'entry'     => '',
  79.                                             'main'      => 'fullsize'
  80.                                         );    
  81.                
  82.                 $builder_stat = ( 'active' == Avia_Builder()->get_alb_builder_status( $post->ID ) );
  83.                 $avia_config['conditionals']['is_builder'] = $builder_stat;
  84.                 $avia_config['conditionals']['is_builder_template'] = $builder_stat;
  85.                
  86.                 /**
  87.                  * @used_by         config-bbpress\config.php
  88.                  * @since 4.5.6.1
  89.                  * @param WP_Post $post
  90.                  * @param int $the_id
  91.                  */
  92.                 do_action( 'ava_before_page_in_footer_compile', $post, $the_id );
  93.                
  94.                 $content = Avia_Builder()->compile_post_content( $post );
  95.                
  96.                 $avia_config = $old_avia_config;
  97.                
  98.                 /**
  99.                  * @since 4.7.4.1
  100.                  * @param string
  101.                  * @param WP_Post $post
  102.                  * @param int $the_id
  103.                  */
  104.                 $extra_class = apply_filters( 'avf_page_as_footer_extra_classes', 'container_wrap footer-page-content footer_color', $post, $the_id );
  105.                
  106.                 /**
  107.                  * Wrap footer page in case we need extra CSS changes
  108.                  *
  109.                  * @since 4.7.4.1
  110.                  */
  111.                 echo '<div class="' . $extra_class . '" id="footer-page">';
  112.                 echo    $content;
  113.                 echo '</div>';
  114.             }
  115.         }
  116.        
  117.         /**
  118.          * Check if we should display a footer
  119.          */
  120.         if( ! $blank && $footer_widget_setting != 'nofooterarea' )
  121.         {
  122.             if( in_array( $footer_widget_setting, array( 'all', 'nosocket' ) ) )
  123.             {
  124.                 //get columns
  125.                 $columns = avia_get_option('footer_columns');
  126.         ?>
  127.                 <div class='container_wrap footer_color' id='footer'>
  128.  
  129.                     <div class='container'>
  130.  
  131.                         <?php
  132.                         do_action('avia_before_footer_columns');
  133.  
  134.                         //create the footer columns by iterating
  135.                         switch( $columns )
  136.                         {
  137.                             case 1:
  138.                                 $class = '';
  139.                                 break;
  140.                             case 2:
  141.                                 $class = 'av_one_half';
  142.                                 break;
  143.                             case 3:
  144.                                 $class = 'av_one_third';
  145.                                 break;
  146.                             case 4:
  147.                                 $class = 'av_one_fourth';
  148.                                 break;
  149.                             case 5:
  150.                                 $class = 'av_one_fifth';
  151.                                 break;
  152.                             case 6:
  153.                                 $class = 'av_one_sixth';
  154.                                 break;
  155.                             default:
  156.                                 $class = '';
  157.                                 break;
  158.                         }
  159.                        
  160.                         $firstCol = "first el_before_{$class}";
  161.  
  162.                         //display the footer widget that was defined at appearenace->widgets in the wordpress backend
  163.                         //if no widget is defined display a dummy widget, located at the bottom of includes/register-widget-area.php
  164.                         for( $i = 1; $i <= $columns; $i++ )
  165.                         {
  166.                             $class2 = ''; // initialized to avoid php notices
  167.                             if( $i != 1 )
  168.                             {
  169.                                 $class2 = " el_after_{$class}  el_before_{$class}";
  170.                             }
  171.                            
  172.                             echo "<div class='flex_column {$class} {$class2} {$firstCol}'>";
  173.                            
  174.                             if( function_exists( 'dynamic_sidebar' ) && dynamic_sidebar( 'Footer - column' . $i ) ) : else : avia_dummy_widget( $i ); endif;
  175.                            
  176.                             echo '</div>';
  177.                            
  178.                             $firstCol = '';
  179.                         }
  180.  
  181.                         do_action( 'avia_after_footer_columns' );
  182.  
  183.     ?>
  184.  
  185.                     </div>
  186.  
  187.                 <!-- ####### END FOOTER CONTAINER ####### -->
  188.                 </div>
  189.  
  190.     <?php   } //endif   array( 'all', 'nosocket' ) ?>
  191.  
  192.  
  193.     <?php
  194.  
  195.             //copyright
  196.             $copyright = do_shortcode( avia_get_option( 'copyright', '&copy; ' . __( 'Copyright', 'avia_framework' ) . "  - <a href='" . home_url( '/' ) . "'>" . get_bloginfo('name') . '</a>' ) );
  197.  
  198.             // you can filter and remove the backlink with an add_filter function
  199.             // from your themes (or child themes) functions.php file if you dont want to edit this file
  200.             // you can also remove the kriesi.at backlink by adding [nolink] to your custom copyright field in the admin area
  201.             // you can also just keep that link. I really do appreciate it ;)
  202.             $kriesi_at_backlink = kriesi_backlink( get_option( THEMENAMECLEAN . "_initial_version" ), 'Enfold' );
  203.  
  204.  
  205.             if( $copyright && strpos( $copyright, '[nolink]' ) !== false )
  206.             {
  207.                 $kriesi_at_backlink = '';
  208.                 $copyright = str_replace( '[nolink]', '', $copyright );
  209.             }
  210.            
  211.             /**
  212.              * @since 4.5.7.2
  213.              * @param string $copyright
  214.              * @param string $copyright_option
  215.              * @return string
  216.              */
  217.             $copyright_option = avia_get_option( 'copyright' );
  218.             $copyright = apply_filters( 'avf_copyright_info', $copyright, $copyright_option );
  219.  
  220.             if( in_array( $footer_widget_setting, array( 'all', 'nofooterwidgets', 'page_in_footer_socket' ) ) )
  221.             {
  222.  
  223.             ?>
  224.  
  225.                 <footer class='container_wrap socket_color' id='socket' <?php avia_markup_helper( array( 'context' => 'footer' ) ); ?>>
  226.                     <div class='container'>
  227.  
  228.                         <span class='copyright'><?php echo $copyright . $kriesi_at_backlink; ?></span>
  229.  
  230.                         <?php
  231.                             if( avia_get_option( 'footer_social', 'disabled' ) != 'disabled' )
  232.                             {
  233.                                 $social_args = array( 'outside'=>'ul', 'inside'=>'li', 'append' => '' );
  234.                                 echo avia_social_media_icons( $social_args, false );
  235.                             }
  236.  
  237.                             $avia_theme_location = 'avia3';
  238.                             $avia_menu_class = $avia_theme_location . '-menu';
  239.  
  240.                             $args = array(
  241.                                         'theme_location'    => $avia_theme_location,
  242.                                         'menu_id'           => $avia_menu_class,
  243.                                         'container_class'   => $avia_menu_class,
  244.                                         'fallback_cb'       => '',
  245.                                         'depth'             => 1,
  246.                                         'echo'              => false,
  247.                                         'walker'            => new avia_responsive_mega_menu( array( 'megamenu' => 'disabled' ) )
  248.                                     );
  249.  
  250.                             $menu = wp_nav_menu( $args );
  251.                            
  252.                             if( $menu )
  253.                             {
  254.                                 echo "<nav class='sub_menu_socket' " . avia_markup_helper( array( 'context' => 'nav', 'echo' => false ) ) . '>';
  255.                                 echo    $menu;
  256.                                 echo '</nav>';
  257.                             }
  258.                         ?>
  259.  
  260.                     </div>
  261.  
  262.                 <!-- ####### END SOCKET CONTAINER ####### -->
  263.                 </footer>
  264.  
  265.  
  266.             <?php
  267.             } //end nosocket check - array( 'all', 'nofooterwidgets', 'page_in_footer_socket' )
  268.  
  269.  
  270.        
  271.        
  272.         } //end blank & nofooterarea check
  273.  
  274.  
  275. // here was the original position of end main !
  276.  
  277.            
  278.         //display link to previous and next portfolio entry
  279.         echo    $avia_post_nav;
  280.        
  281.         echo "<!-- end wrap_all --></div>";
  282.  
  283.  
  284.         if( isset( $avia_config['fullscreen_image'] ) )
  285.         { ?>
  286.             <!--[if lte IE 8]>
  287.             <style type="text/css">
  288.             .bg_container {
  289.             -ms-filter:"progid:DXImageTransform.Microsoft.AlphaImageLoader(src='<?php echo $avia_config['fullscreen_image']; ?>', sizingMethod='scale')";
  290.             filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='<?php echo $avia_config['fullscreen_image']; ?>', sizingMethod='scale');
  291.             }
  292.             </style>
  293.             <![endif]-->
  294.         <?php
  295.             echo "<div class='bg_container' style='background-image:url(" . $avia_config['fullscreen_image'] . ");'></div>";
  296.         }
  297.     ?>
  298.  
  299.  
  300. <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>
  301.  
  302. <div id="fb-root"></div>
  303.  
  304. <?php
  305.  
  306.     /* Always have wp_footer() just before the closing </body>
  307.      * tag of your theme, or you will break many plugins, which
  308.      * generally use this hook to reference JavaScript files.
  309.      */
  310.     wp_footer();
  311.    
  312. ?>
  313. </body>
  314. </html>
  315.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement