Really, really, really messed up sidebar.
-
Okay so I made a sidebar and used jQuery to make it work how I wanted. It all works fine… Except for one thing… If I insert the code I use to get the most popular posts it completely screws up the sidebar, somehow mimicing the entire website. I have no idea why on earth it’s doing do but it’s awful and I haven’t a clue how to fix it.
The site in question is: https://tutshelf.com you’ll see what I mean when you look.
the code being used is:
<?php $popular_posts = $wpdb->get_results("SELECT id,post_title FROM {$wpdb->prefix}posts ORDER BY comment_count DESC LIMIT 0,5); foreach($popular_posts as $post) { print "<li><a href='". get_permalink($post->id) ."'>".$post->post_title."</a>\n"; }?>
I’ve checked if it’s definitly the code and it is – when I commented it out everything was fine. Also I had to type that code out by hand on an iPhone because my internets died so if the code has any errors in it it’ll just be a typo, unless it’s something obviously wrong.
please reply as this is a very annoying problem and one I have no idea how to fix. Any help is appriciated, Alex.
- The topic ‘Really, really, really messed up sidebar.’ is closed to new replies.