Advertisement
Guenni007

footer

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