code to html problem
-
Hello guys,
I’m trying to convert this bit of code to inactive php / html :
<h2>Popular Posts</h2> <ul> <?php $result = $wpdb->get_results("SELECT comment_count,ID,post_title FROM $wpdb->posts ORDER BY comment_count DESC LIMIT 0 , 5"); foreach ($result as $post) { setup_postdata($post); $postid = $post->ID; $title = $post->post_title; $commentcount = $post->comment_count; if ($commentcount != 0) { ?> <li><a href="<?php echo get_permalink($postid); ?>" title="<?php echo $title ?>"> <?php echo $title ?></a> {<?php echo $commentcount ?>}</li> <?php } } ?> </ul>
I’m trying to write it with the html special entities, in the post html editor but doesn’t seems to work : 404 not found when I publish…
I’m using this online tool : https://www.palfrader.org/code2html/code2html.html
Any ideas are appreciated
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘code to html problem’ is closed to new replies.