All pastes #565836 Raw Edit

Blogroll Code in 2.1

public text v1 · immutable
·published 2007-06-14 05:35 UTC
rendered paste body
<?php global $freshy_options; ?>
	
	<div id="sidebar">
		<div>
		<?php if ( !function_exists('dynamic_sidebar')
        || !dynamic_sidebar() ) : ?>
		<?php if(function_exists('yy_menu')) : ?>
			<h2><?php _e('Navigation',TEMPLATE_DOMAIN); ?></h2>
			<ul>
			<?php yy_menu('sort_column=menu_order&title_li=',
								'hide_empty=0&sort_column=name&optioncount=1&title_li=&hierarchical=1&feed=RSS&feed_image='.get_bloginfo('stylesheet_directory').'/images/icons/feed-icon-16x16.gif'); ?>
			</ul>
	
		<?php elseif (function_exists('freshy_menu')) : 
			freshy_menu($freshy_options['args_pages'],$freshy_options['args_cats']);
		endif; ?>
				
			<h2><?php _e('Search',TEMPLATE_DOMAIN); ?></h2>
			<?php include (TEMPLATEPATH . '/searchform.php'); ?>

			<h2><?php _e('Links',TEMPLATE_DOMAIN); ?></h2>
			<ul>
			 <?php
			 $ver = substr(get_bloginfo('version'), 0, 3);
			 if ($ver == "2.1") {
				$link_cats = $wpdb->get_results("SELECT DISTINCT cat_name, category_id FROM $wpdb->categories INNER JOIN $wpdb->link2cat ON $wpdb->categories.cat_id=$wpdb->link2cat.category_id");
				foreach ($link_cats as $link_cat) {
				?>
				<li id="linkcat-<?php echo $link_cat->cat_id; ?>"><?php echo $link_cat->cat_name; ?>
				<ul>
				<?php wp_get_links('category='.$link_cat->category_id.'&before=<li>&after=</li>&show_description=0&limit=100'); ?></li>
				</ul>
				<?php }
			 }
			 //if ($ver>2) echo 'yes';
			 else {
			 $link_cats = $wpdb->get_results("SELECT cat_id, cat_name FROM $wpdb->linkcategories");
			 foreach ($link_cats as $link_cat) {
			 ?>
			  <li id="linkcat-<?php echo $link_cat->cat_id; ?>"><?php echo $link_cat->cat_name; ?>
			   <ul>
			    <?php wp_get_links($link_cat->cat_id); ?>
			   </ul>

			  </li>
			 <?php }
			 } ?>
<!-- Added by Spencer on 1/30/2006 -->
<?php /* If this is the frontpage */ if ( is_home() || is_page() ) { ?>

				<li><h2>Meta</h2>
				<ul>
					<?php wp_register(); ?>
					<li><?php wp_loginout(); ?></li>
					<li><a href="http://validator.w3.org/check/referer" title="This page validates as XHTML 1.0 Transitional">Valid <abbr title="eXtensible HyperText Markup Language">XHTML</abbr></a></li>
					<li><a href="http://gmpg.org/xfn/"><abbr title="XHTML Friends Network">XFN</abbr></a></li>
					<li><a href="http://wordpress.org/" title="Powered by WordPress, state-of-the-art semantic personal publishing platform.">WordPress</a></li>
					<?php wp_meta(); ?>
				</ul>
				</li>
			<?php } ?>
<!-- End addition. -->
			</ul>
		<?php endif; ?>
		</div>
	</div>