No... Don't work for me. Forget that, I got one more important problem. I use
List category posts and
WP-PostViews. I created table and it works perfect:
link but when I add one column for postviews and code it breaks my whole site.
Now look at my code, how I add it.
Code:
<?php
//Show category?
if ($cat_link_string != ''){
$lcp_output = '<p><strong>' . $cat_link_string . '</strong></p>';
}else{
$lcp_output = '';
}
$lcp_output .= '<table width="100%" border="1">
<tr>
<th>Pavadinimas</th>
<th>Komentarų skaičius</th>
<th>Parašymo data</th>
<th>Post Views</th>
</tr>';//For default ul
//Posts loop:
foreach($catposts as $single):
$lcp_output .= '<tr>
<td><a href="' . get_permalink($single->ID) . '">' . $single->post_title . '</a></td>';
//Show comments?
if($atts['comments'] == yes){
$lcp_output .= '<td>' . $single->comment_count . '</td>';
}
//Style for date:
if($atts['date']=='yes'){
$lcp_output .= '<td>' . get_the_time($atts['date_format'], $single).'</td>';
}
echo '<td>';
if(function_exists('the_views')) { the_views(); }
echo '</td>';
//Show author?
if($atts['author']=='yes'){
$lcp_userdata = get_userdata($single->post_author);
$lcp_output .=" - ".$lcp_userdata->display_name;
}
//Show content?
if($atts['content']=='yes' && $single->post_content){
$lcpcontent = apply_filters('the_content', $single->post_content); // added to parse shortcodes
$lcpcontent = str_replace(']]>', ']]>', $lcpcontent); // added to parse shortcodes
$lcp_output .= '<p>' . $lcpcontent . '</p>'; // line tweaked to output filtered content
}
//Show excerpt?
if($atts['excerpt']=='yes' && !($atts['content']=='yes' && $single->post_content) ){
$lcp_output .= lcp_excerpt($single);
}
$lcp_output .='';
endforeach;
$lcp_output .= '</table>';
?>
This is how my site looks broken
Maybe you can help me? I'm really not good at php, I think I made some mistakes or what? Why it breaks my whole site? Please help me if you can