Articles Tagged 'UL'

WordPress: improving the list of comments

The standard template of WordPress (as others) normally provide for an alternate layout for the list of comments. In the standard template of such a class is set css alt , according to the logic:

1
2
3
4
5
/ / File comments.php
$oddcomment ; ?> id="comment- <?php comment_ID ( ) ?> "> <Li <? Php echo $ oddcomment;?> Id = "comment-<? Php COMMENT_ID ()?>">
[...]
/ * Changes every other comment to a different class * /
Oddcomment = $ (empty ($ oddcomment))? 'Class = "alt"':'';

) e una volta a class="alt" . This means that the tag li $oddcomment is set once a blank ( "" ) and once a class="alt" . A modification could be useful to introduce another class when the author of the blog to comment on a post:

image

I, for example, I used the following code in the comments.php file:

1
2
3
4
5
<Php
( $comment -> user_id == 3 ) ? ' Authcomment = $ ($ comment -> user_id == 3)? ' '' ; authcomment ':'';
( empty ( $classcomment ) ) ? ( ( $authcomment == '' ) ? ' alt' : '' ) : '' ; Classcomment = $ ( empty ($ classcomment))? (($ authcomment =='')? 'alt':''):'';
?>
?> <?= $authcomment ?> " id="comment- <?php comment_ID ( ) ?> "> <Li class = "<? = $ Classcomment?> <? = $ Authcomment?>" Id = "comment-<? Php COMMENT_ID ()?>">

del vostro utente. The line $comment-&gt;user_id==3 may vary according to ' ID of your user. I, for one, do not use the administrator to respond on the blog, but I have my user ID=3 . , se usate questa utenza potete scrivere: $comment-&gt;user_id==1 . Normally the ' ID of the administrator is 1 , if you use that user can write: $comment-&gt;user_id==1 . In this way, besides having the alternate layout on comments left by visitors, the answer is immediately recognizable author of the blog.

Continued ...

Create a pipe separator through CSS

You can often see a number of links distributed horizontally separated by pipe "|", the graphic symbol dell'asticella vertical. . In addition, if there is a good writing HTML, you realize that this list of links - apparently horizontal - are nothing but bulleted lists UL or OL . It follows that instead of writing:

1
2
3
< p >
"#1" > Link 1 < / a > | < a href = "#2" > Link 2 < / a > | < a href = "#n" > Link n < / a > < a href = "# 1"> Link 1 </ a > | < a href = "# 2"> Link 2 </ a > | < a href = "# n"> n Link </ a >
</ p >

It would be better to use:

1
2
3
4
5
< ul >
= "#1" > Link 1 < / a >< / li > < will > < a href = "# 1"> Link 1 </ a > </ them >
= "#2" > Link 2 < / a >< / li > < will > < a href = "# 2"> Link 2 </ a > </ them >
= "#n" > Link n < / a >< / li > < will > < a href = "# n"> n Link </ a > </ them >
</ ul >

Continued ...