Salutare!
Have a problema de gradinita spre clasa intai! Se da www.sevenshop.ro , un site de probe , ce continte una bucata wordpress si o thema blank editata in fel si chip de je + cateva functii noi etc , pe scurt "developez" acea thema.
E si acum sa va zic problema, am facut 3 widget area noi punand in functions.php :
if (function_exists('register_sidebar')) {
register_sidebar(array(
'name' => 'Sidebar 2',
'id' => 'sidebar 2',
'description' => 'These are widgets for the sidebar.',
'before_widget' => '<ul><li><div id="%1$s"class="widget %2$s">',
'after_widget' => '</div></li></ul>',
'before_title' => '<h2>',
'after_title' => '</h2>'
));
}
De 3 ori logic fiecare cu numele si id-ul lui. La inceput am incercat in index sa apelez aceste 3 widgeturi cu php include sidebar1.php sidebar2.php si sidebar3.php toate adaugate intr-un div adica cam asa:
<div id="coloane"><ul><li>
<php include(TEMPLATEPATH . '/sidebar1.php');?>
<php include(TEMPLATEPATH . '/sidebar2.php');?>
<php include(TEMPLATEPATH . '/sidebar3.php');?>
</li></ul></div>
Iar acestui div i-am dat urmatorul cod css:
#coloane{
margin:0 auto;
display: block ;
list-style:none;
}
#coloane ul{
margin:0;
padding:0;
padding-top:5px;
padding-left:5px;
list-style:none;
}
#coloane ul li{
margin:0;
padding:0 5 0 0;
width:316px;
display: inline; float:left;
}
#coloane h2{
text-align:center;
}
Si nu reusc sa afiseze aceste 3 widgeturi in line , orizontal etc. Unde gresesc? cum pot sa afisez widgeturile in linie?
Toate bune!
Wordpress widgets in line!
Moderator: Moderatori
Re: Wordpress widgets in line!
Cred ca te pot ajuta,chiar acum lucrez la o tema wordpress pentru filme sau jocuri si tocmai ce am inregistrat 10 widgeturi noi.
In header.php unde aveam e nevoie sa apara noile widgeturile am codul acesta:
<?php include('top.php'); ?>
in top.php le chem pe toate 5 prin acest cod:
<div id="top-widget">
<ul>
<li>
<?php dynamic_sidebar('top-one'); ?>
</li>
<li>
<?php dynamic_sidebar('top-two'); ?>
</li>
<li>
<?php dynamic_sidebar('top-three'); ?>
</li>
<li>
<?php dynamic_sidebar('top-four'); ?>
</li>
<li>
<?php dynamic_sidebar('top-five'); ?>
</li>
</ul>
</div>
in functions.php le-am inregistrat asa:
/* sidebar top */
//sidebar top 1
register_sidebar(array(
'name' => __( 'Widget-top 1'),
'id' => 'top-one',
'description' => __( 'Widgets top' ),
'before_widget' => '<div class="footer-widget %2$s clearfix">',
'after_widget' => '</div>',
'before_title' => '<h4>',
'after_title' => '</h4>',
));
//sidebar top 2
register_sidebar(array(
'name' => __( 'Widget-top 2'),
'id' => 'top-two',
'description' => __( 'Widgets top' ),
'before_widget' => '<div class="footer-widget %2$s clearfix">',
'after_widget' => '</div>',
'before_title' => '<h4>',
'after_title' => '</h4>'
));
//sidebar top 3
register_sidebar(array(
'name' => __( 'Widget-top 3'),
'id' => 'top-three',
'description' => __( 'Widgets top' ),
'before_widget' => '<div class="footer-widget %2$s clearfix">',
'after_widget' => '</div>',
'before_title' => '<h4>',
'after_title' => '</h4>',
));
//sidebar top 4
register_sidebar(array(
'name' => __( 'Widget-top 4'),
'id' => 'top-four',
'description' => __( 'Widgets top' ),
'before_widget' => '<div class="footer-widget %2$s clearfix">',
'after_widget' => '</div>',
'before_title' => '<h4>',
'after_title' => '</h4>',
));
//sidebar top 5
register_sidebar(array(
'name' => __( 'Widget-top 5'),
'id' => 'top-five',
'description' => __( 'Widgets top' ),
'before_widget' => '<div class="footer-widget %2$s clearfix">',
'after_widget' => '</div>',
'before_title' => '<h4>',
'after_title' => '</h4>',
));
'id' => 'top-one' este id-ul care te ajuta sa le chemi si poate fi modificat cum vrei dar sa fie la fel si in top.php
css-ul arata asa:
/* Top-widget ---------------------------------------*/
#top-widget {
list-style:none;
overflow: hidden;
height:100%;
width:940px;
background:transparent;
padding-top:20px;
margin-left:20px;
margin-bottom:30px;
}
h4 {
text-transform:uppercase;
background:#333;
font-weight: normal;
text-align: center;
clear: both;
padding:5px;
color: #fff;
font-size: 14px;
font-family: Verdana, Helvetica, Arial, sans-serif;
}
#top-widget ul {
width: 990px;
float: left;
list-style: none;
margin: 0px;
padding: 0px;
}
#top-widget li {
line-height:20px;
margin-left:3px;
float:left;
width:180px;
padding:3px;
color:red;
text-decoration:none;
font-size:13px;
font-family: verdana, monospace, arial;
color:#333;
letter-spacing:-1px;
}
#top-widget li a{
color:#222;
}
#top-widget li a:hover {color: red; }
tu ai nevoie doar de 2 widgeturi sper sa te descuri daca nu reusesti asta e blogul meu http://bucurion.info/
iar demo la tema care e inca in lucru este aici: http://demo.wpteme.info/
In header.php unde aveam e nevoie sa apara noile widgeturile am codul acesta:
<?php include('top.php'); ?>
in top.php le chem pe toate 5 prin acest cod:
<div id="top-widget">
<ul>
<li>
<?php dynamic_sidebar('top-one'); ?>
</li>
<li>
<?php dynamic_sidebar('top-two'); ?>
</li>
<li>
<?php dynamic_sidebar('top-three'); ?>
</li>
<li>
<?php dynamic_sidebar('top-four'); ?>
</li>
<li>
<?php dynamic_sidebar('top-five'); ?>
</li>
</ul>
</div>
in functions.php le-am inregistrat asa:
/* sidebar top */
//sidebar top 1
register_sidebar(array(
'name' => __( 'Widget-top 1'),
'id' => 'top-one',
'description' => __( 'Widgets top' ),
'before_widget' => '<div class="footer-widget %2$s clearfix">',
'after_widget' => '</div>',
'before_title' => '<h4>',
'after_title' => '</h4>',
));
//sidebar top 2
register_sidebar(array(
'name' => __( 'Widget-top 2'),
'id' => 'top-two',
'description' => __( 'Widgets top' ),
'before_widget' => '<div class="footer-widget %2$s clearfix">',
'after_widget' => '</div>',
'before_title' => '<h4>',
'after_title' => '</h4>'
));
//sidebar top 3
register_sidebar(array(
'name' => __( 'Widget-top 3'),
'id' => 'top-three',
'description' => __( 'Widgets top' ),
'before_widget' => '<div class="footer-widget %2$s clearfix">',
'after_widget' => '</div>',
'before_title' => '<h4>',
'after_title' => '</h4>',
));
//sidebar top 4
register_sidebar(array(
'name' => __( 'Widget-top 4'),
'id' => 'top-four',
'description' => __( 'Widgets top' ),
'before_widget' => '<div class="footer-widget %2$s clearfix">',
'after_widget' => '</div>',
'before_title' => '<h4>',
'after_title' => '</h4>',
));
//sidebar top 5
register_sidebar(array(
'name' => __( 'Widget-top 5'),
'id' => 'top-five',
'description' => __( 'Widgets top' ),
'before_widget' => '<div class="footer-widget %2$s clearfix">',
'after_widget' => '</div>',
'before_title' => '<h4>',
'after_title' => '</h4>',
));
'id' => 'top-one' este id-ul care te ajuta sa le chemi si poate fi modificat cum vrei dar sa fie la fel si in top.php
css-ul arata asa:
/* Top-widget ---------------------------------------*/
#top-widget {
list-style:none;
overflow: hidden;
height:100%;
width:940px;
background:transparent;
padding-top:20px;
margin-left:20px;
margin-bottom:30px;
}
h4 {
text-transform:uppercase;
background:#333;
font-weight: normal;
text-align: center;
clear: both;
padding:5px;
color: #fff;
font-size: 14px;
font-family: Verdana, Helvetica, Arial, sans-serif;
}
#top-widget ul {
width: 990px;
float: left;
list-style: none;
margin: 0px;
padding: 0px;
}
#top-widget li {
line-height:20px;
margin-left:3px;
float:left;
width:180px;
padding:3px;
color:red;
text-decoration:none;
font-size:13px;
font-family: verdana, monospace, arial;
color:#333;
letter-spacing:-1px;
}
#top-widget li a{
color:#222;
}
#top-widget li a:hover {color: red; }
tu ai nevoie doar de 2 widgeturi sper sa te descuri daca nu reusesti asta e blogul meu http://bucurion.info/
iar demo la tema care e inca in lucru este aici: http://demo.wpteme.info/
Cine este conectat
Utilizatori ce ce navighează pe acest forum: Niciun utilizator înregistrat și 8 vizitatori