Advertisement
Guenni007

footer

Aug 17th, 2021 (edited)
1,255
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 9.67 KB | None | 0 0
  1.         <?php
  2.        
  3.         if ( ! defined( 'ABSPATH' ) ) {  exit;  }    // Exit if accessed directly
  4.        
  5.         // Footer und Socket outside #main  see line 271
  6.         echo '<div id="abstand"></div>'; // additional container for curtain effect calculation
  7.         echo '<!-- edited footer, new end main --> </div> ';           
  8.        
  9.         do_action( 'ava_before_footer' );  
  10.            
  11.         global $avia_config;
  12.         $blank = isset( $avia_config['template'] ) ? $avia_config['template'] : '';
  13.  
  14.         //reset wordpress query in case we modified it
  15.         wp_reset_query();
  16.  
  17.  
  18.         //get footer display settings
  19.         $the_id = avia_get_the_id(); //use avia get the id instead of default get id. prevents notice on 404 pages
  20.         $footer = get_post_meta( $the_id, 'footer', true );
  21.         $footer_options = avia_get_option( 'display_widgets_socket', 'all' );
  22.        
  23.         //get link to previous and next post/portfolio entry
  24.         $avia_post_nav = avia_post_nav();
  25.  
  26.         /**
  27.          * Reset individual page override to defaults if widget or page settings are different (user might have changed theme options)
  28.          * (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)
  29.          */
  30.         if( false !== strpos( $footer_options, 'page' ) )
  31.         {
  32.             /**
  33.              * User selected a page as footer in main options
  34.              */
  35.             if( ! in_array( $footer, array( 'page_in_footer_socket', 'page_in_footer', 'nofooterarea' ) ) )
  36.             {
  37.                 $footer = '';
  38.             }
  39.         }
  40.         else
  41.         {
  42.             /**
  43.              * User selected a widget based footer in main options
  44.              */
  45.             if( in_array( $footer, array( 'page_in_footer_socket', 'page_in_footer' ) ) )
  46.             {
  47.                 $footer = '';
  48.             }
  49.         }
  50.        
  51.         $footer_widget_setting  = ! empty( $footer ) ? $footer : $footer_options;
  52.  
  53.         /*
  54.          * Check if we should display a page content as footer
  55.          */
  56.         if( ! $blank && in_array( $footer_widget_setting, array( 'page_in_footer_socket', 'page_in_footer' ) ) )
  57.         {
  58.             /**
  59.              * Allows 3rd parties to change page id's, e.g. translation plugins
  60.              */
  61.             $post = AviaCustomPages()->get_custom_page_object( 'footer_page', '' );
  62.            
  63.             if( ( $post instanceof WP_Post ) && ( $post->ID != $the_id ) )
  64.             {
  65.                 /**
  66.                  * Make sure that footerpage is set to fullwidth
  67.                  */
  68.                 $old_avia_config = $avia_config;
  69.                
  70.                 $avia_config['layout']['current'] = array(
  71.                                             'content'   => 'av-content-full alpha',
  72.                                             'sidebar'   => 'hidden',
  73.                                             'meta'      => '',
  74.                                             'entry'     => '',
  75.                                             'main'      => 'fullsize'
  76.                                         );    
  77.                
  78.                 $builder_stat = ( 'active' == Avia_Builder()->get_alb_builder_status( $post->ID ) );
  79.                 $avia_config['conditionals']['is_builder'] = $builder_stat;
  80.                 $avia_config['conditionals']['is_builder_template'] = $builder_stat;
  81.                
  82.                 /**
  83.                  * @used_by         config-bbpress\config.php
  84.                  * @since 4.5.6.1
  85.                  * @param WP_Post $post
  86.                  * @param int $the_id
  87.                  */
  88.                 do_action( 'ava_before_page_in_footer_compile', $post, $the_id );
  89.                
  90.                 $content = Avia_Builder()->compile_post_content( $post );
  91.                
  92.                 $avia_config = $old_avia_config;
  93.                
  94.                 /**
  95.                  * @since 4.7.4.1
  96.                  * @param string
  97.                  * @param WP_Post $post
  98.                  * @param int $the_id
  99.                  */
  100.                 $extra_class = apply_filters( 'avf_page_as_footer_extra_classes', 'container_wrap footer-page-content footer_color', $post, $the_id );
  101.                
  102.                 /**
  103.                  * Wrap footer page in case we need extra CSS changes
  104.                  *
  105.                  * @since 4.7.4.1
  106.                  */
  107.                 echo '<div class="' . $extra_class . '" id="footer-page">';
  108.                 echo    $content;
  109.                 echo '</div>';
  110.             }
  111.         }
  112.        
  113.         /**
  114.          * Check if we should display a footer
  115.          */
  116.         if( ! $blank && $footer_widget_setting != 'nofooterarea' )
  117.         {
  118.             if( in_array( $footer_widget_setting, array( 'all', 'nosocket' ) ) )
  119.             {
  120.                 //get columns
  121.                 $columns = avia_get_option('footer_columns');
  122.         ?>
  123.                 <div class='container_wrap footer_color' id='footer'>
  124.  
  125.                     <div class='container'>
  126.  
  127.                         <?php
  128.                         do_action('avia_before_footer_columns');
  129.  
  130.                         //create the footer columns by iterating
  131.                         switch( $columns )
  132.                         {
  133.                             case 1:
  134.                                 $class = '';
  135.                                 break;
  136.                             case 2:
  137.                                 $class = 'av_one_half';
  138.                                 break;
  139.                             case 3:
  140.                                 $class = 'av_one_third';
  141.                                 break;
  142.                             case 4:
  143.                                 $class = 'av_one_fourth';
  144.                                 break;
  145.                             case 5:
  146.                                 $class = 'av_one_fifth';
  147.                                 break;
  148.                             case 6:
  149.                                 $class = 'av_one_sixth';
  150.                                 break;
  151.                             default:
  152.                                 $class = '';
  153.                                 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 ) ) : else : avia_dummy_widget( $i ); endif;
  171.                            
  172.                             echo '</div>';
  173.                            
  174.                             $firstCol = '';
  175.                         }
  176.  
  177.                         do_action( 'avia_after_footer_columns' );
  178.  
  179.     ?>
  180.  
  181.                     </div>
  182.  
  183.                 <!-- ####### END FOOTER CONTAINER ####### -->
  184.                 </div>
  185.  
  186.     <?php   } //endif   array( 'all', 'nosocket' ) ?>
  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.                             $avia_theme_location = 'avia3';
  234.                             $avia_menu_class = $avia_theme_location . '-menu';
  235.  
  236.                             $args = array(
  237.                                         'theme_location'    => $avia_theme_location,
  238.                                         'menu_id'           => $avia_menu_class,
  239.                                         'container_class'   => $avia_menu_class,
  240.                                         'fallback_cb'       => '',
  241.                                         'depth'             => 1,
  242.                                         'echo'              => false,
  243.                                         'walker'            => new avia_responsive_mega_menu( array( 'megamenu' => 'disabled' ) )
  244.                                     );
  245.  
  246.                             $menu = wp_nav_menu( $args );
  247.                            
  248.                             if( $menu )
  249.                             {
  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.  
  271. <!-- </div>  edited footer, that was the original Position of end main -->
  272.        
  273.        
  274.         <?php
  275.        
  276.        
  277.         //display link to previous and next portfolio entry
  278.         echo    $avia_post_nav;
  279.        
  280.         echo "<!-- end wrap_all --></div>";
  281.  
  282.  
  283.         if( isset( $avia_config['fullscreen_image'] ) )
  284.         { ?>
  285.             <!--[if lte IE 8]>
  286.             <style type="text/css">
  287.             .bg_container {
  288.             -ms-filter:"progid:DXImageTransform.Microsoft.AlphaImageLoader(src='<?php echo $avia_config['fullscreen_image']; ?>', sizingMethod='scale')";
  289.             filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='<?php echo $avia_config['fullscreen_image']; ?>', sizingMethod='scale');
  290.             }
  291.             </style>
  292.             <![endif]-->
  293.         <?php
  294.             echo "<div class='bg_container' style='background-image:url(" . $avia_config['fullscreen_image'] . ");'></div>";
  295.         }
  296.     ?>
  297.  
  298.  
  299. <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>
  300.  
  301. <div id="fb-root"></div>
  302.  
  303. <?php
  304.  
  305.     /* Always have wp_footer() just before the closing </body>
  306.      * tag of your theme, or you will break many plugins, which
  307.      * generally use this hook to reference JavaScript files.
  308.      */
  309.     wp_footer();
  310.    
  311. ?>
  312. </body>
  313. </html>
  314.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement