您好,我有一些 php 正在为我生成一个列表。我添加了
<?php
$termid = arg(2);
$terms = taxonomy_get_related($termid, $key = 'tid');
//print_r($terms);
foreach($terms as $term){
$link = url('taxonomy/term/'.$term->tid);
echo '<li><a href="'.$link.'">'.$term->name.'</a></li>';
}
?>
不过,我想为我的列表设置样式并尝试了-
<div class="sidey"><?php
$termid = arg(2);
$terms = taxonomy_get_related($termid, $key = 'tid');
//print_r($terms);
foreach($terms as $term){
$link = url('taxonomy/term/'.$term->tid);
echo '<li><a href="'.$link.'">'.$term->name.'</a></li>';
}
?></div>
和-
.sidey .inner ul li, .sidey .view-content div.views-row {
border-bottom-color: #DDDDDD;
list-style-image: none;
line-height: 130%;
padding: 5px 0;
border-bottom-style: solid;
border-bottom-width: 1px;
}
但没有效果。这应该有效还是我在这里错过了一些非常基本的东西?我觉得我是。也试过这个,但再次无济于事-
<?php
$termid = arg(2);
$terms = taxonomy_get_related($termid, $key = 'tid');
//print_r($terms);
foreach($terms as $term){
$link = url('taxonomy/term/'.$term->tid);
echo '<div id="sidey"><li><a href="'.$link.'">'.$term->name.'</a></li></div>';
}
?>
谁能指出我正确的方向?谢谢