Suporte » Temas » footer.php com problemas

  • Resolvido cortesfsa

    (@cortesfsa)



    Uso um tema no wordpress que possui um sidebar no rodapé. Mas ele não aparece. O que tá acontecendo?

    Esse é o footer.php. Eu coloquei <?php get_footer(); ?> no local apropriado nos arquivos [i]page.php, index.php, single.php, search.php (página “Resultados da pesquisa “)[/i]

    <!-- Footer Starts -->
    	<div id="footer-wrap">
    	<div id="footer">
    
    	<?php if ( ( function_exists('dynamic_sidebar') && (is_active_sidebar(3) || is_active_sidebar(4) || is_active_sidebar(5)) ) ) : ?>
    
    		<!-- Footer Widget Area Starts -->
    		<div class="footer-widgets">
    
    			<div class="block">
    				<?php dynamic_sidebar(3); ?>
    			</div>
    
    			<div class="block">
    				<?php dynamic_sidebar(4); ?>
    			</div>
    
    			<div class="block last">
    				<?php dynamic_sidebar(5); ?>
    			</div>
    
    		</div>
    		<!-- Footer Widget Area Ends -->
    
    		<div class="fix"></div>
    
    	<?php endif; ?>
    
    		<div id="credits">
    
    			<div id="copyright" class="col-left">
    				<p>&copy; <?php echo date('Y'); ?> <?php bloginfo(); ?>. <?php _e('<a href="http://www.uniq-themes.ru">All Rights Reserved.</a>', 'freethemes') ?></p>
    			</div>
    
    			<div id="credit" class="col-right">
    				<p><?php _e('Powered by', 'freethemes') ?> <a href="http://www.wordpress.org">WordPress</a>. <?php _e('Designed by', 'freethemes') ?> <a href="http://www.freethemes.com"><img src="<?php bloginfo('template_directory'); ?>/images/freethemes.png" width="87" height="21" alt="free Themes" /></a></p>
    			</div>
    
    		</div>
    
    	</div>
    	</div>
    	<!-- Footer Ends -->
    
    </div><!-- /#container -->
    <?php wp_footer(); ?>
    <?php if ( get_option('free_google_analytics') <> "" ) { echo stripslashes(get_option('free_google_analytics')); } ?>
    </body>
    </html>

    O style.css tá assim:

    /* 2.6 Footer */
    #footer{ background:#828282; color:#cacaca; font-family:Georgia, "Times New Roman", Times, serif; font-style:italic; font-size:11px;padding: 25px 0;border-top: 1px solid #b3b3b3;}
    #footer a { color:#cacaca; }
    #footer a:hover { border-bottom:1px dotted; }
    #footer #credit img{vertical-align:middle; }
    #footer #credit span{display:none;}
    
    /* 2.6.1 Footer Widget Area */
    #footer-widgets{ position:relative; background:url(images/bevel-footer-widgets.png) repeat-x top; background-color:#c1c0c0; border-bottom:1px solid #7b7b7b; }
    #footer-widgets .container { background:url(images/bg-footer-widgets.png) no-repeat center 2px; padding:30px 0 10px; }
    #footer-widgets .block { width:300px; float:left; margin:0 30px 0px 0; }
    #footer-widgets .block.last { margin-right:0;; }
    #footer-widgets .widget h3  { background:url(images/bg-footer-widget-title.png) repeat-x; text-shadow: #fff 0px 1px 0px;}

    E finalmente o meu functions.php

    <?php
    
    //Start Theme Functions - Please refrain from editing this file.
    
    $functions_path = TEMPLATEPATH . '/functions/';
    $includes_path = TEMPLATEPATH . '/includes/';
    
    (... cortei essa parte ... )
    
    // Widgets  & Sidebars
    require_once ($includes_path . 'sidebar-init.php');
    
    require_once ($includes_path . 'theme-widgets.php');
    
    add_action('wp_head', 'freethemes_wp_head');
    add_action('admin_menu', 'freethemes_add_admin');
    add_action('admin_head', 'freethemes_admin_head');    
    
    ?>

    Pelo o que eu entendi, as funções responsáveis devem estar em sidebar-init.php na pasta [i]/includes/[/i], então aqui vai ele:

    <?php
    
    // Register widgetized areas
    
    function the_widgets_init() {
        if ( !function_exists('register_sidebars') )
            return;
    
        register_sidebar(array('name' => 'Sidebar Top','id' => 'sidebar-top','before_widget' => '<div id="%1$s" class="widget %2$s">','after_widget' => '</div>','before_title' => '<h3>','after_title' => '</h3>'));
        register_sidebar(array('name' => 'Sidebar','id' => 'sidebar-1','before_widget' => '<div id="%1$s" class="widget %2$s">','after_widget' => '</div>','before_title' => '<h3>','after_title' => '</h3>'));
        register_sidebar(array('name' => 'Footer 1','id' => 'footer-1','before_widget' => '<div id="%1$s" class="widget %2$s">','after_widget' => '</div>','before_title' => '<h3>','after_title' => '</h3>'));
        register_sidebar(array('name' => 'Footer 2','id' => 'footer-2','before_widget' => '<div id="%1$s" class="widget %2$s">','after_widget' => '</div>','before_title' => '<h3>','after_title' => '</h3>'));
        register_sidebar(array('name' => 'Footer 3','id' => 'footer-3','before_widget' => '<div id="%1$s" class="widget %2$s">','after_widget' => '</div>','before_title' => '<h3>','after_title' => '</h3>'));
    }
    
    add_action( 'init', 'the_widgets_init' );
    
    ?>

    O que está errado então?

Visualizando 1 resposta (de um total de 1)
  • Ah! Eu consegui! Eu sou mesmo burro:

    No footer.php deveria acrescentar
    [quote]<div id=”footer-widgets”>
    <div class=”container col-full”>
    <?php if ( ( function_exists(‘dynamic_sidebar’) && (is_active_sidebar(‘footer-1’) || is_active_sidebar(‘footer-2’) || is_active_sidebar(‘footer-3’)) ) ) : ?>

    <!– Footer Widget Area Starts –>
    <div class=”footer-widgets”>

    <div class=”block”>
    <?php dynamic_sidebar(‘footer-1’); ?>
    </div>

    <div class=”block”>
    <?php dynamic_sidebar(‘footer-2’); ?>
    </div>

    <div class=”block last”>
    <?php dynamic_sidebar(‘footer-3’); ?>
    </div>

    </div>
    <!– Footer Widget Area Ends –>

    <div class=”fix”></div>

    <?php endif; ?>
    <div class=”fix”/>
    </div>
    </div>[/quote]

    E no style.css
    [quote].fix {
    clear:both;
    height:1px;
    margin:-1px 0 0;
    overflow:hidden;
    }
    [/quote]

Visualizando 1 resposta (de um total de 1)
  • O tópico ‘footer.php com problemas’ está fechado para novas respostas.