Cum sa ai un footer.php mai flexibil.

Am gasit la o tema wordpress niste coduri cum sa faci ca sa ai inca 3 sidebar in footer.php in afara de sidebarul normal.Le-am introdus la o tema la care lucrez acum si a mers.Asadar iata codurile.

In functions.php trebuie sa inregistram cele 3 sidebar noi:

 

if ( function_exists(‘register_sidebar’) )
register_sidebar(array(
‘name’=> ‘Footer Left’,
‘id’ => ‘footer-left’,
‘description’ => ‘Widgets in this area will be shown in the footer left area.’,
‘before_widget’ => ‘<div class=”footer-widget clearfix”>’,
‘after_widget’ => ‘</div>’,
‘before_title’ => ‘<h4>’,
‘after_title’ => ‘</h4>’,
));
if ( function_exists(‘register_sidebar’) )
register_sidebar(array(
‘name’ => ‘Footer Middle’,
‘id’ => ‘footer-middle’,
‘description’ => ‘Widgets in this area will be shown in the footer middle area.’,
‘before_widget’ => ‘<div class=”footer-widget clearfix”>’,
‘after_widget’ => ‘</div>’,
‘before_title’ => ‘<h4>’,
‘after_title’ => ‘</h4>’,
));
if ( function_exists(‘register_sidebar’) )
register_sidebar(array(
‘name’ => ‘Footer Right’,
‘id’ => ‘footer-right’,
‘description’ => ‘Widgets in this area will be shown in the footer right area.’,
‘before_widget’ => ‘<div class=”footer-widget clearfix”>’,
‘after_widget’ => ‘</div>’,
‘before_title’ => ‘<h4>’,
‘after_title’ => ‘</h4>’,
));

 

In style.css se introduce acest cod:

/* footer */

#footer {
background-color:#2a2d2d;
clear: both;
width: 100%;
color:#222;
font-size:9pt;
}
#footerc {width:900px;margin:0 auto;}
#footer p{padding:14px 0;margin: 0; color: #eee; text-align:center;}
#footer a{color: #fff;text-decoration: none;}
#footer a:hover{color: #BADA55;text-decoration: underline;}
#footer h2{font-size:12pt;font-family:arial;color:#fff;font-weight:bold;margin:0 0 5px;}

#tagcloud {color:#0332FF;
background-color:#F7FFD4;
}
#footer_text {background-color:#F7FFD4;
color:#0548FF;
height:30px;
float: center;
}
/* Footer Widgets */

#footer-widget-wrap{

}

#footer-left,
#footer-middle,
#footer-right{
float: left;
width: 260px;
margin-top: 30px;
padding-left:15px;
}
#footer-right {

}
#footer-middle{
margin-left: 30px;
margin-right: 20px;
}
#footer-right{
}
.footer-widget{
color: #fff;
margin-bottom: 30px;
}
.footer-widget h4{
color: #fff;
font-size: 16px;
margin: 0 0 20px;
}
.footer-widget li{
padding: 10px 0;
border-bottom: 1px solid #ccc;
}
.footer-widget ul li:first-child{
border-top: 1px solid #ccc;
}
.footer-widget li:first-child{
border-top: 1px solid #ccc;
}

/*flickr widget footer*/

#footer .gopress-flickr-widget li{
border: 0px;
padding: 0px;
}
#footer .gopress-flickr-widget{
margin-right: -4px;
}
#footer .gopress-flickr-widget a{
float: left;
width: 57px;
height: 57px;
margin-right: 4px;
margin-bottom: 4px;
border: 5px solid #222;
-webkit-transition: all 0.2s ease-in-out;
-moz-transition: all 0.2s ease-in-out;
-o-transition: all 0.2s ease-in-out;
-ms-transition: all 0.2s ease-in-out;
transition: all 0.2s ease-in-out;
}
#footer .gopress-flickr-widget a:hover{
border-color: #1f82cb;
}
#footer .gopress-flickr-widget img{
display: block;
width: 57px;
height: 57px;
}

In footer.php avem acest cod:

<div id=”footer”>

<div id=”footer-widget-wrap” class=”clearfix”>

<div id=”footer-left”>
<?php dynamic_sidebar(‘footer-left’); ?>
</div>

<div id=”footer-middle”>
<?php dynamic_sidebar(‘footer-middle’); ?>
</div>

<div id=”footer-right”>
<?php dynamic_sidebar(‘footer-right’); ?>
</div>

</div>
</div>

 

5 comentarii la “Cum sa ai un footer.php mai flexibil.

  1. raspunsul este unul simplu:

    in style.css al temei ar trebuii sa aveti codul pentru textul la comentarii adica ‘textarea’

    La mine codul este asa:
    textarea { background-image:url(images/h4.jpg);

    in folderul images al temei voastre setati orice poza care sa nu depaseasca 600px cu 400px.Poate sa fie jpg sau png.

  2. Se vede ca te pasioneaza temele de wordpress. Felicitari !

    P.S. Nu se prea potriveste culoarea folosita la titlurile din footer cu schema generala de culori pe care o ai in restul blogului.

Lasă un răspuns

Adresa ta de email nu va fi publicată. Câmpurile obligatorii sunt marcate cu *

Alte articole Populare