shelwriter Posted July 10, 2006 Posted July 10, 2006 Hey guys - I am brand new to using WP and I have been playing around with some themes and stuff. One of the themes that I really love is giving me a huge error message. I found out where and how to edit it, but I don't know what to edit. Can you help? My page is: http://www.shellecastlesmelton.com You'll see the error there. Here's the page with the code. Do you see anything wrong?? <div id="leftcol"> <ul> <br /> <li><!-- Calendar --> <div class="sidebartext"> <?php get_calendar(1); ?> </div> </li><!-- End of Calendar --> <br /> <li><!-- Popular Tags --> <h2><?php _e('Popular Tags'); ?></h2> <?php $minfont = 8; $maxfont = 12; $fontunit = "px"; $category_ids_to_exclude = ""; popular_tags($minfont, $maxfont, $fontunit, $category_ids_to_exclude); ?> </li><!-- End Popular Tags --> <br /><br /> <li><!-- Latest Post --> <h2><?php _e('Latest Post'); ?></h2> <?php query_posts('showposts=10'); ?> <ul> <?php if (have_posts()) : while (have_posts()) : the_post(); ?> <li><a href="<?php the_permalink() ?>"><span class="date"><?php the_time('m.j') ?></span> <?php the_title() ?> </a></li> <?php endwhile; endif; ?> </ul> </li><!-- End of Latest --> <li><!-- Recent Comments --> <h2><?php _e('Recent Comments'); ?></h2> <ul> <?php get_recent_comments(); ?> </ul> </li><!-- End of Comments --> <li><!-- Recently Commented Post --> <h2><?php _e('Recently Updated'); ?></h2> <ul> <?php c2c_get_recently_modified(3); ?> </ul> </li><!-- End Recently Commented Post --> <li><!-- Categories --> <h2><?php _e('Categories'); ?></h2> <ul> <?php list_cats(0, '', 'name', 'asc', '', 1, 0, 1, 1, 1, 1, 0,'','','','','') ?> </ul> </li><!-- End of Categories --> <li><!-- Archives --> <h2><?php _e('Archives By Month'); ?></h2> <ul> <?php wp_get_archives('type=monthly'); ?> </ul> </li><!-- End of Archives --> <?php if ( is_home() ) { ?> <?php if (function_exists('wp_theme_switcher')) { ?> <li><!-- Theme switcher --> <h2><?php _e('Themes'); ?></h2> <?php wp_theme_switcher(); ?> </li><!-- End of Theme switcher --> <?php } ?> <li><!-- Blog Stats --> <h2><?php _e('Blog Stats'); ?></h2> <?php $numposts = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->posts WHERE post_status = 'publish'"); if (0 < $numposts) $numposts = number_format($numposts); $numcomms = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->comments WHERE comment_approved = '1'"); if (0 < $numcomms) $numcomms = number_format($numcomms); $numcats = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->categories"); if (0 < $numcats) $numcats = number_format($numcats); ?> <div class="text"><?php printf(__('There are currently <span class="counts">%1$s</span> posts and <span class="counts">%2$s</span> comments, contained within <span class="counts">%3$s</span> categories.'), $numposts, $numcomms, $numcats); ?></div> </li><!-- End Blog Stats--> <?php } ?> </ul> </div> Anyone see anything wrong? I just don't know coding at all. Thanks in advance. Quote
TCH-Bruce Posted July 10, 2006 Posted July 10, 2006 This is the code that is producing the error. <!-- Popular Tags --> <?php _e('Popular Tags'); ?> <?php $minfont = 8; $maxfont = 12; $fontunit = "px"; $category_ids_to_exclude = ""; popular_tags($minfont, $maxfont, $fontunit, $category_ids_to_exclude); ?> <!-- End Popular Tags --> I would assume that Popular Tags is a plugin that you do not have installed and activated. If you don't want to install it, remove that code from the leftsidebar.php file. Quote
shelwriter Posted July 10, 2006 Author Posted July 10, 2006 Hey Bruce - I actually took out the popular tags code - then, I got another error for Latest Posts.... I'm assuming that I'll either have to remove all of those codes - - - OR - - - install those plugins. Right? I don't know anything about plugins, but there's a place in WP admin to go to plugins. Is that where I go and what do I do to install them? Is it as simple as uploading it into my CPanel? Where would I install them? Thanks for the fast reply!! Quote
TCH-Bruce Posted July 10, 2006 Posted July 10, 2006 Different plugins have different installtion instructions. Most require that you download the plugin from the repository or author's site and upload it into your plugins directory. Then in the admin panel you activate the plugin. Then you are required to put pieces of PHP code in your templates where you wish the plugin to display. Quote
shelwriter Posted July 10, 2006 Author Posted July 10, 2006 Okay, that makes sense. I found some plugin sites and some of the plugins are cool. I know what to do now. Bless you guys!! THIS is why I love TCH!! Thank you!!!!!! Quote
abinidi Posted July 11, 2006 Posted July 11, 2006 That is why a lot of templates for WP have codes like this: ><?php if (function_exists('wp_theme_switcher')) { ?> <hr class="hr1" /><br> <li><h2><?php _e('themes'); ?></h2> <ul><?php wp_theme_switcher(); ?> </ul> <?php } ?> This code basically checks to see if the plugin is installed. If it is installed, it runs the plugin code right there. If the plugin isn't installed, then it ignores this secion of code (closed by the closing curley bracket in the last command). It's a handy piece of code. I try to add that code in whenever I modify my templates with plugin code, so that if I ever have to disable my plugins the pages still render. Good luck. Quote
TCH-Bruce Posted July 11, 2006 Posted July 11, 2006 It's a handy piece of code. I try to add that code in whenever I modify my templates with plugin code, so that if I ever have to disable my plugins the pages still render. Yes, I have started adding my plugin code the same way. Sure makes it easy to enable and disable them if you are having problems. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.