Advertisement
Guenni007

footer

Nov 14th, 2019
395
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 10.79 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.             ?>
  108.                 <div class='container_wrap footer_color' id='footer'>
  109.  
  110.                     <div class='container'>
  111.  
  112.                         <?php
  113.                         do_action('avia_before_footer_columns');
  114.  
  115.                         //create the footer columns by iterating
  116.  
  117.                         switch($columns)
  118.                         {
  119.                             case 1: $class = ''; break;
  120.                             case 2: $class = 'av_one_half'; break;
  121.                             case 3: $class = 'av_one_third'; break;
  122.                             case 4: $class = 'av_one_fourth'; break;
  123.                             case 5: $class = 'av_one_fifth'; break;
  124.                             case 6: $class = 'av_one_sixth'; break;
  125.                             default: $class = ''; break;
  126.                         }
  127.                        
  128.                         $firstCol = "first el_before_{$class}";
  129.  
  130.                         //display the footer widget that was defined at appearenace->widgets in the wordpress backend
  131.                         //if no widget is defined display a dummy widget, located at the bottom of includes/register-widget-area.php
  132.                         for ($i = 1; $i <= $columns; $i++)
  133.                         {
  134.                             $class2 = ""; // initialized to avoid php notices
  135.                             if($i != 1) $class2 = " el_after_{$class}  el_before_{$class}";
  136.                             echo "<div class='flex_column {$class} {$class2} {$firstCol}'>";
  137.                             if (function_exists('dynamic_sidebar') && dynamic_sidebar('Footer - column'.$i) ) : else : avia_dummy_widget($i); endif;
  138.                             echo "</div>";
  139.                             $firstCol = "";
  140.                         }
  141.  
  142.                         do_action('avia_after_footer_columns');
  143.  
  144.                         ?>
  145.  
  146.  
  147.                     </div>
  148.  
  149.  
  150.                 <!-- ####### END FOOTER CONTAINER ####### -->
  151.                 </div>
  152.  
  153.         <?php   } //endif   array( 'all', 'nosocket' ) ?>
  154.  
  155.  
  156.  
  157.            
  158.  
  159.         <?php
  160.  
  161.             //copyright
  162.             $copyright = do_shortcode( avia_get_option( 'copyright', "&copy; ".__('Copyright','avia_framework')."  - <a href='".home_url('/')."'>".get_bloginfo('name')."</a>") );
  163.  
  164.             // you can filter and remove the backlink with an add_filter function
  165.             // from your themes (or child themes) functions.php file if you dont want to edit this file
  166.             // you can also remove the kriesi.at backlink by adding [nolink] to your custom copyright field in the admin area
  167.             // you can also just keep that link. I really do appreciate it ;)
  168.             $kriesi_at_backlink = kriesi_backlink(get_option(THEMENAMECLEAN."_initial_version"), 'Enfold');
  169.  
  170.  
  171.             if( $copyright && strpos( $copyright, '[nolink]' ) !== false )
  172.             {
  173.                 $kriesi_at_backlink = '';
  174.                 $copyright = str_replace( '[nolink]', '', $copyright );
  175.             }
  176.            
  177.             /**
  178.              * @since 4.5.7.2
  179.              * @param string $copyright
  180.              * @param string $copyright_option
  181.              * @return string
  182.              */
  183.             $copyright_option = avia_get_option( 'copyright' );
  184.             $copyright = apply_filters( 'avf_copyright_info', $copyright, $copyright_option );
  185.  
  186.             if( in_array( $footer_widget_setting, array( 'all', 'nofooterwidgets', 'page_in_footer_socket' ) ) )
  187.             {
  188.  
  189.                 //get socket_columns
  190.                 $socket_columns = avia_get_option('socket_columns');
  191.  
  192.             ?>
  193.  
  194.                 <footer class='container_wrap socket_color' id='socket' <?php avia_markup_helper(array('context' => 'footer')); ?>>
  195.                     <div class='container'>
  196.  
  197.                         <span class='copyright'><?php echo $copyright . $kriesi_at_backlink; ?></span>
  198.  
  199.                         <?php
  200.                             if(avia_get_option('footer_social', 'disabled') != "disabled")
  201.                             {
  202.                                 $social_args    = array('outside'=>'ul', 'inside'=>'li', 'append' => '');
  203.                                 echo avia_social_media_icons($social_args, false);
  204.                             }
  205.                        
  206.                            
  207.                                 $avia_theme_location = 'avia3';
  208.                                 $avia_menu_class = $avia_theme_location . '-menu';
  209.  
  210.                                 $args = array(
  211.                                     'theme_location'=>$avia_theme_location,
  212.                                     'menu_id' =>$avia_menu_class,
  213.                                     'container_class' =>$avia_menu_class,
  214.                                     'fallback_cb' => '',
  215.                                     'depth'=>1,
  216.                                     'echo' => false,
  217.                                     'walker' => new avia_responsive_mega_menu(array('megamenu'=>'disabled'))
  218.                                 );
  219.  
  220.                             $menu = wp_nav_menu($args);
  221.                            
  222.                             if($menu){
  223.                             echo "<nav class='sub_menu_socket' ".avia_markup_helper(array('context' => 'nav', 'echo' => false)).">";
  224.                             echo $menu;
  225.                             echo "</nav>";
  226.                             }
  227.  
  228.                     //socket widget area
  229.  
  230.                             echo "<div id='socket-widget-row'>";  //newly added to have widgetarea in socket
  231.                             echo "<div class='hr hr-short hr-center'><span class='hr-inner'><span class='hr-inner-style'></span></span></div>";
  232.                             switch($socket_columns)
  233.                             {
  234.                                 case 1: $class = ''; break;
  235.                                 case 2: $class = 'av_one_half'; break;
  236.                                 case 3: $class = 'av_one_third'; break;
  237.                                 case 4: $class = 'av_one_fourth'; break;
  238.                                 case 5: $class = 'av_one_fifth'; break;
  239.                                 case 6: $class = 'av_one_sixth'; break;
  240.                             }
  241.                            
  242.                             $firstCol = "first el_before_{$class}";
  243.  
  244.                             //display the socket widget that was defined at appearenace->widgets in the wordpress backend
  245.                             //if no widget is defined display a dummy widget, located at the bottom of includes/register-widget-area.php
  246.                             for ($i = 1; $i <= $socket_columns; $i++)
  247.                             {
  248.                                 $class2 = ""; // initialized to avoid php notices
  249.                                 if($i != 1) $class2 = " el_after_{$class}  el_before_{$class}";
  250.                                 echo "<div class='flex_column {$class} {$class2} {$firstCol}'>";
  251.                                 if (function_exists('dynamic_sidebar') && dynamic_sidebar('Socket - column'.$i) ) : else : avia_dummy_widget($i); endif;
  252.                                 echo "</div>";
  253.                                 $firstCol = "";
  254.                             }
  255.  
  256.                             echo "</div>";
  257.                             //end of socket widget area
  258.  
  259.                         ?>
  260.  
  261.                     </div>
  262.  
  263.                 <!-- ####### END SOCKET CONTAINER ####### -->
  264.                 </footer>
  265.  
  266.  
  267.             <?php
  268.             } //end nosocket check - array( 'all', 'nofooterwidgets', 'page_in_footer_socket' )
  269.  
  270.  
  271.        
  272.        
  273.         } //end blank & nofooterarea check
  274.         ?>
  275.         <!-- end main -->
  276.         </div>
  277.        
  278.         <?php
  279.        
  280.        
  281.         //display link to previous and next portfolio entry
  282.         echo    $avia_post_nav;
  283.        
  284.         echo "<!-- end wrap_all --></div>";
  285.  
  286.  
  287.         if(isset($avia_config['fullscreen_image']))
  288.         { ?>
  289.             <!--[if lte IE 8]>
  290.             <style type="text/css">
  291.             .bg_container {
  292.             -ms-filter:"progid:DXImageTransform.Microsoft.AlphaImageLoader(src='<?php echo $avia_config['fullscreen_image']; ?>', sizingMethod='scale')";
  293.             filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='<?php echo $avia_config['fullscreen_image']; ?>', sizingMethod='scale');
  294.             }
  295.             </style>
  296.             <![endif]-->
  297.         <?php
  298.             echo "<div class='bg_container' style='background-image:url(".$avia_config['fullscreen_image'].");'></div>";
  299.         }
  300.     ?>
  301.  
  302.  
  303. <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>
  304.  
  305. <div id="fb-root"></div>
  306.  
  307. <?php
  308.  
  309.     /* Always have wp_footer() just before the closing </body>
  310.      * tag of your theme, or you will break many plugins, which
  311.      * generally use this hook to reference JavaScript files.
  312.      */
  313.  
  314. wp_footer();
  315. ?>
  316. </body>
  317. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement