2017-11-15 2 views
-2

Entschuldigung, ich bin ein kompletter Neuling bei diesem, meine Frage klingt vielleicht dumm zu einigen. Ich habe die Wartung einer WordPress-Site übernommen, die von einem anderen Entwickler ausgeführt wurde, der nicht mehr erreichbar ist. Ich habe Probleme mit der Anzeige des Inhalts auf der folgenden Seite https://www.covalin.com/product-category/boxes/metallic-boxes/, wenn ich die Anzahl der Produkte auf der Seite auf etwas höher als 9 angezeigt, dann schiebt es die Fußzeile in die Mitte der Seite und zeigt Produkte unter der Fußzeile. Ich möchte alle Produkte unter jeder Unterkategorie finden können. Bitte sehen Sie sich die Screenshots unten an, um sich ein Bild von dem Problem zu machen. Jede Anleitung wird am meisten appreciated, ich habe Stunden damit verbracht, herauszufinden, dass dies möglich ist.WordPress Footer über Inhalt

Wenn ich das folgende CSS unten verwende, löst es teilweise das Problem, aber schafft ein anderes, wo der gesamte Inhalt scrollbar ist, aber hinter der Fußzeile erscheint.

CSS-Code -

.footer { 
position: fixed; 
bottom:0; 
} 

PHP-Code verwendet, die die Anzahl der Produkte Anzeige wechselt, nach letzten dev hinzugefügt:

/*---------- woo-product pagination number setting ------------*/ 

add_filter('loop_shop_per_page', 'new_loop_shop_per_page', 20); 

function new_loop_shop_per_page($cols) { 
// $cols contains the current number of products per page based on the value 
stored on Options -> Reading 
// Return the number of products you wanna show per page. 
$cols = 27; //I changed this from 27 to 9 for the page to display properly. 
return $cols; 
} 

How the site looks like with 9 products on a page

How the site looks like with 27 products on a page

aktualisiert - mit footer.php Datei unter

<?php 
 
/** 
 
* The template for displaying the footer 
 
* 
 
* Contains footer content and the closing of the #main and #page div elements. 
 
* 
 
* @package WordPress 
 
* @subpackage Twenty_Fourteen 
 
* @since Twenty Fourteen 1.0 
 
*/ 
 
?> 
 

 
<?php // Check if site turned to boxed version 
 
\t $boxed = ''; $boxed_element = ''; $row_class = ''; 
 
\t if (get_option('site_layout')=='boxed') {$boxed = 'container'; $boxed_element = 'col-md-12 col-sm-12'; $row_class = 'row';} 
 
?> 
 

 
\t \t <?php if ($boxed && $boxed!='') { ?> 
 
\t \t \t </div> 
 
\t \t \t <div class='row'> 
 
\t \t <?php } ?> 
 

 

 
<?php if (class_exists('Woocommerce')): ?> 
 
\t <?php if(is_shop() || is_product() && is_active_sidebar('footer-bottom-shop')): ?> 
 
\t \t \t \t \t 
 
\t <?php if (!$boxed || $boxed=='') : ?><div class="container"> 
 
\t \t \t \t \t \t \t \t \t \t <div class="row"><?php endif; ?> 
 
\t \t \t \t \t \t \t \t \t \t \t <div class="shop-bottom-sidebar col-xs-12 col-sm-12 col-md-12"> 
 
\t \t \t \t \t \t \t \t \t \t \t \t <?php dynamic_sidebar('footer-bottom-shop'); ?> 
 
\t \t \t \t \t \t \t \t \t \t \t </div> 
 
\t <?php if (!$boxed || $boxed=='') : ?></div> 
 
\t \t \t \t \t \t \t \t \t </div><?php endif; ?> 
 
\t <?php endif ?> 
 
<?php endif ?> 
 
\t \t 
 
\t \t <footer id="colophon" class="site-footer <?php echo esc_attr($boxed_element);?>"> 
 

 
\t \t \t <?php 
 
\t \t \t \t if (get_option('site_footer_top_background_option') && get_option('site_footer_top_background_option')!=''){ 
 
\t \t \t \t \t $site_footer_top_background_option = get_option('site_footer_top_background_option'); 
 
\t \t \t \t } 
 
\t \t \t \t else{$site_footer_top_background_option='';} 
 
\t \t \t ?> 
 
\t \t 
 
\t \t <?php if(is_active_sidebar('footer-top-sidebar-1') || is_active_sidebar('footer-top-sidebar-2')): ?> 
 
\t \t \t <div class="footer-top widget-area <?php echo esc_attr($row_class);?>" style="background:<?php echo esc_attr($site_footer_top_background_option); ?>;"> \t 
 
\t \t \t \t <?php if (!$boxed || $boxed=='') : ?><div class="container"> 
 
\t \t \t \t <div class="row"><?php endif; ?> 
 

 
\t \t \t \t <div class="col-xs-12 col-sm-6 col-md-6 footertopsidebarone"> 
 
\t \t \t \t \t <?php if(is_active_sidebar('footer-top-sidebar-1')): ?> 
 
\t \t \t \t \t \t <?php dynamic_sidebar('footer-top-sidebar-1'); ?> 
 
\t \t \t \t \t <?php endif;?> 
 
\t \t \t \t </div> 
 

 
\t \t \t \t <div class="col-xs-12 col-sm-6 col-md-6 footertopsidebartwo"> 
 
\t \t \t \t \t <?php if(is_active_sidebar('footer-top-sidebar-2')): ?> 
 
\t \t \t \t \t \t <?php dynamic_sidebar('footer-top-sidebar-2'); ?> 
 
\t \t \t \t \t <?php endif;?> 
 
\t \t \t \t </div> 
 
\t \t \t \t 
 
\t \t \t \t <?php if (!$boxed || $boxed=='') : ?></div></div><?php endif; ?> 
 
\t \t \t </div> 
 
\t \t <?php endif; ?> 
 

 
\t \t <?php 
 
\t \t \t \t if (get_option('site_middle_background_option') && get_option('site_middle_background_option')!=''){ 
 
\t \t \t \t \t $site_middle_background_option = get_option('site_middle_background_option'); 
 
\t \t \t \t } 
 
\t \t \t \t else{$site_middle_background_option='';} 
 
\t \t ?> 
 
\t \t \t <div class="footer-middle widget-area <?php echo esc_attr($row_class);?>" style="background:<?php echo esc_attr($site_middle_background_option);?>"> 
 
\t \t \t \t <?php if (!$boxed || $boxed=='') : ?><div class="container"> 
 
\t \t \t \t \t <div class="row"><?php endif; ?> 
 
\t \t \t \t \t <?php 
 
\t \t \t \t \t \t if (get_option('footer_bg_img') && get_option('footer_bg_img')!=''){ 
 
\t \t \t \t \t \t $footer_bg_img_url = get_option('footer_bg_img'); 
 
\t \t \t \t \t } 
 
\t \t \t \t \t else{$footer_bg_img_url='';} 
 
\t \t \t \t \t 
 
\t \t \t \t \t if (get_option('footer_bg_img_position') && get_option('footer_bg_img_position')!=''){ 
 
\t \t \t \t \t \t $footer_bg_img_position = get_option('footer_bg_img_position'); 
 
\t \t \t \t \t \t switch($footer_bg_img_position){ 
 
\t \t \t \t \t \t \t case "right": 
 
\t \t \t \t \t \t \t \t $storex_footer_bg_position='96%'; 
 
\t \t \t \t \t \t \t \t break; 
 
\t \t \t \t \t \t \t case "left": 
 
\t \t \t \t \t \t \t \t $storex_footer_bg_position='4%'; 
 
\t \t \t \t \t \t \t \t break; 
 
\t \t \t \t \t \t } 
 
\t \t \t \t \t } 
 
\t \t \t \t \t else{$storex_footer_bg_position='';} 
 
\t \t \t \t \t 
 
\t \t \t \t \t ?> 
 
\t \t \t \t \t \t <div class="fotter-bg-img" style="background: url(<?php echo esc_url($footer_bg_img_url)?>) no-repeat transparent; background-position:<?php echo esc_attr($storex_footer_bg_position)?> 90%"> 
 
\t \t \t \t \t 
 
\t \t \t \t \t \t \t <div class="col-xs-12 col-sm-6 col-md-3"> 
 
\t \t \t \t \t \t \t \t <?php if (is_active_sidebar('footer-sidebar-1')) : ?> 
 
\t \t \t \t \t \t \t \t \t <?php dynamic_sidebar('footer-sidebar-1'); ?> 
 
\t \t \t \t \t \t \t \t <?php endif; ?> 
 
\t \t \t \t \t \t \t </div> 
 
\t \t \t \t \t \t \t <div class="col-xs-12 col-sm-6 col-md-3"> 
 
\t \t \t \t \t \t \t \t <?php if (is_active_sidebar('footer-sidebar-2')) : ?> 
 
\t \t \t \t \t \t \t \t <?php dynamic_sidebar('footer-sidebar-2'); ?> 
 
\t \t \t \t \t \t \t \t <?php endif; ?> 
 
\t \t \t \t \t \t \t </div> 
 
\t \t \t \t \t \t \t <div class="col-xs-12 col-sm-6 col-md-3"> 
 
\t \t \t \t \t \t \t \t <?php if (is_active_sidebar('footer-sidebar-3')) : ?> 
 
\t \t \t \t \t \t \t \t \t <?php dynamic_sidebar('footer-sidebar-3'); ?> 
 
\t \t \t \t \t \t \t \t \t <?php endif; ?> 
 
\t \t \t \t \t \t \t </div> 
 
\t \t \t \t \t \t \t <div class="col-xs-12 col-sm-6 col-md-3"> 
 
\t \t \t \t \t \t \t \t <?php if (is_active_sidebar('footer-sidebar-4')) : ?> 
 
\t \t \t \t \t \t \t \t \t <?php dynamic_sidebar('footer-sidebar-4'); ?> 
 
\t \t \t \t \t \t \t \t <?php endif; ?> 
 
\t \t \t \t \t \t \t </div> 
 
\t \t \t \t \t \t </div> 
 
\t \t \t \t \t \t 
 
\t \t \t \t \t <?php if (!$boxed || $boxed=='') : ?></div> 
 
\t \t \t \t </div><?php endif; ?> 
 
\t \t \t </div> 
 

 
\t \t \t <?php 
 
\t \t \t \t if (get_option('site_footer_bottom_background_option') && get_option('site_footer_bottom_background_option')!=''){ 
 
\t \t \t \t \t $site_bottom_background_option = get_option('site_footer_bottom_background_option'); 
 
\t \t \t \t } 
 
\t \t \t \t else{$site_bottom_background_option='';} 
 
\t \t \t \t 
 
\t \t \t ?> 
 
\t \t \t 
 
\t \t \t <div id="footer-bottom" style="background:<?php echo esc_attr($site_bottom_background_option); ?>;" class="<?php echo esc_attr($row_class);?> footer-bottom"> 
 
\t \t \t \t <?php if (!$boxed || $boxed=='') : ?><div class="container"> 
 
\t \t \t \t \t <div class="row"><?php endif; ?> 
 
\t \t \t \t \t \t <div class="col-xs-12 col-sm-6 col-md-6"> 
 
\t \t \t \t \t \t \t <?php if (has_nav_menu('footer-nav')) : ?><!-- Footer navigation --> 
 
\t \t \t \t \t \t \t \t <nav id="site-navigation-footer" class="footer-navigation"> 
 
\t \t \t \t \t \t \t \t \t <?php wp_nav_menu(array('theme_location' => 'footer-nav')); ?> \t \t \t \t \t \t \t 
 
\t \t \t \t \t \t \t \t </nav> 
 
\t \t \t \t \t \t <?php endif; ?><!-- Footer navigation --> 
 

 
\t \t \t \t \t \t <div class="site-info"> 
 
\t \t \t \t \t \t \t <?php $copyright = esc_attr(get_option('site_copyright')); 
 
\t \t \t \t \t \t \t if ($copyright != '') { 
 
\t \t \t \t \t \t \t \t echo esc_attr($copyright); 
 
\t \t \t \t \t \t \t } else { 
 
\t \t \t \t \t \t \t \t echo 'Storex &copy; '.date('Y') .''.esc_html__(' Theme by Themes Zone. All rights reserved', 'storex'); 
 
\t \t \t \t \t \t \t } 
 
\t \t \t \t \t \t \t ?> 
 
\t \t \t \t \t \t </div> 
 

 
\t \t \t \t \t \t </div> 
 

 
\t \t \t \t \t \t <div class="col-xs-12 col-sm-6 col-md-6"> 
 
\t \t \t \t \t \t \t <?php if (is_active_sidebar('footer-bottom')) : ?> 
 
          \t <?php dynamic_sidebar('footer-bottom'); ?> 
 
         \t <?php endif; ?> 
 
\t \t \t \t \t \t </div> 
 

 
\t \t \t \t \t <?php if (!$boxed || $boxed=='') : ?></div> 
 
\t \t \t \t </div><?php endif; ?> 
 
\t \t \t </div> 
 
\t \t \t 
 
\t \t </footer><!-- #colophon --> 
 
\t \t <?php if ($boxed && $boxed!='') { ?> 
 
\t \t \t </div> 
 
\t \t <?php } ?> 
 
</div><!-- #page --> 
 

 
<script> 
 
\t jQuery(document).ready(function() { 
 
\t \t 
 
\t \t jQuery('.quantity').append("<span class='qty-cus'>Qty</span>"); 
 
\t \t 
 
\t \t jQuery('.wc-forward').val('View Order'); 
 
jQuery('.update_cart').val('Update Order'); 
 
\t \t 
 
\t \t }); 
 

 
\t \t //review order table text changes 
 
\t \t jQuery(window).on('load',function(){ 
 
\t \t setTimeout(function() { //calls click event after a certain time 
 
\t \t \t jQuery('.cart-subtotal th').text('Order SubTotal'); 
 
\t \t \t }, 3000); 
 
\t \t jQuery('.update_cart').val('Update Order'); 
 

 
\t \t jQuery('.page-template-special-offer .header-stripe h1.title').text('SPECIAL OFFERS'); 
 

 
\t \t jQuery('.product-description-wrapper > .quantity').remove(); 
 
\t \t }); 
 

 
\t \t var cloned_field = jQuery('.register p.form-row.full').clone(); 
 
\t \t jQuery('#custom_fax_no').append(cloned_field); 
 
\t \t jQuery('.register p.form-row.full').eq(0).remove(); 
 

 

 
\t \t 
 
\t \t jQuery(window).scroll(function(){ 
 
\t   var winScroll= jQuery(window).scrollTop(); 
 
\t \t \t console.log(winScroll); 
 

 
\t   if(winScroll>0){ 
 
\t   \t jQuery('.header-top').addClass('sticky'); 
 
\t   }else{ 
 
\t   \t jQuery('.header-top').removeClass('sticky'); 
 
\t   } 
 
\t \t }); 
 

 
</script> 
 

 
\t \t <?php wp_footer(); ?> 
 
\t </body> 
 
</html>

+2

Sie müssen hier ein vollständiges Beispiel des Problemcodes in Ihrer Frage und nicht auf Ihrer Website anzeigen. [mcve] – Rob

+0

Setze $ cols auf 27 und du wirst sehr schnell Hilfe bekommen, ich bin mir sicher ... du hast eine feste Höhe, irgendwo in CSS, das Problem verursacht, ich denke ... – sinisake

Antwort

0

Das Problem ist, dass Sie nicht die <div> richtig schließen.

Derzeit ist es wie

<div id="page" class="hfeed site container"> 
    <div class='row custom_header'> 
     <!-- some contents..... --> 
    </div> 
    <div class='row'> 
     <div id="main" class="site-main col-md-12 col-sm-12"> 
      <!-- some contents..... --> 
     </div> 
     <div class='row'> 
      <footer id="colophon" class="site-footer col-md-12 col-sm-12"> 
       <!-- some contents... --> 
      </footer> 
     </div> 
    </div> 
</div> 

es sein sollte,

<div id="page" class="hfeed site container"> 
    <div class='row custom_header'> 
     <!-- some contents... --> 
    </div> 
    <div class='row'> 
     <div id="main" class="site-main col-md-12 col-sm-12"> 
      <!-- some contents... --> 
     </div> 
    </div> 
    <div class='row'> 
     <footer id="colophon" class="site-footer col-md-12 col-sm-12"> 
      <!-- some contents... --> 
     </footer> 
    </div> 
</div> 

Es gibt keine Notwendigkeit besteht, die CSS zu ändern.

+0

Hallo, vielen Dank für deine schnelle Antwort. Ich bin mir nicht sicher, wo ich die Änderungen vornehmen soll. Ich habe meine gesamte footer.php-Datei oben eingefügt. Ich habe nicht den Code, wie ich vorher erwähnt habe, also bin ich verloren was genau darin vorgeht. –

Verwandte Themen