<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Jefferson&#039;s Newspaper &#187; wordpress</title>
	<atom:link href="http://jeffersonsnewspaper.org/tags/wordpress/feed/" rel="self" type="application/rss+xml" />
	<link>http://jeffersonsnewspaper.org</link>
	<description>A blog about information, education, and the (digital) humanities...</description>
	<lastBuildDate>Thu, 02 Feb 2012 16:01:26 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Tips for Using the WordPress Admin Bar with BuddyPress</title>
		<link>http://jeffersonsnewspaper.org/2012/tips-for-using-the-wordpress-admin-bar-with-buddypress/</link>
		<comments>http://jeffersonsnewspaper.org/2012/tips-for-using-the-wordpress-admin-bar-with-buddypress/#comments</comments>
		<pubDate>Fri, 20 Jan 2012 15:47:18 +0000</pubDate>
		<dc:creator>E. Bell</dc:creator>
				<category><![CDATA[Reference]]></category>
		<category><![CDATA[buddypress]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[wordpress network]]></category>
		<category><![CDATA[wpmu]]></category>

		<guid isPermaLink="false">http://jeffersonsnewspaper.org/?p=1227</guid>
		<description><![CDATA[If you run a WordPress Network that uses BuddyPress, you are probably aware of the distinctions between the WordPress and BuddyPress admin bars (or in the latter case, the &#8220;buddy bar&#8221;), so we can jump right to the point: You are no longer using the buddy bar, and are now using the core admin bar; there is something you don&#8217;t like about this arrangement and you need to change it. Well, here are a few...]]></description>
			<content:encoded><![CDATA[<p><img src="http://jeffersonsnewspaper.org/wp-content/uploads/2012/01/helmets.png" alt="" title="Admin Bar vs. Admin Bar"  class="aligncenter size-full wp-image-1245" /><br />
If you run a WordPress Network that uses BuddyPress, you are probably aware of the distinctions between the WordPress and BuddyPress admin bars (or in the latter case, the &#8220;buddy bar&#8221;), so we can jump right to the point: You are no longer using the buddy bar, and are now using the core admin bar; there is something you don&#8217;t like about this arrangement and you need to change it. Well, here are a few quick tricks.</p>
<p><span id="more-1227"></span></p>
<p>Each of these snippets (with one noted exception) can be added to functions.php of your main blog theme or you can create a simple <a href="http://codex.wordpress.org/Writing_a_Plugin" title="Writing a plugin @ WP Codex">plugin</a>. </p>
<h4>Swap the BuddyBar for the Admin Bar</h4>
<p>If you somehow are still using the buddy bar, try one of the following methods. (You may also need to adjust your CSS slightly to accommodate the differences between the two admin bars.)</p>
<p>Here is the preferred BuddyPress method, which is simply added to wp-config.php:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">/*
** Add the following to wp-config.php
** Removes BP admin bar and replaces it with the WP admin bar
*/</span>
<span style="color: #990000;">define</span><span style="color: #009900;">&#40;</span> ‘BP_USE_WP_ADMIN_BAR’<span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">true</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>If for some reason you find that the above method does not work, you may try adding the following to functions.php</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #666666; font-style: italic;">/*
** The following removes BP admin bar and replaces it with the WP admin bar
*/</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> remove_bp_adminbar<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
     remove_action<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'wp_footer'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'bp_core_admin_bar'</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">8</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
     remove_action<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'admin_footer'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'bp_core_admin_bar'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
     show_admin_bar<span style="color: #009900;">&#40;</span><span style="color: #009900; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
add_action<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'after_setup_theme'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'remove_bp_adminbar'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<h4>Remove something from the Admin Bar</h4>
<p>To remove a menu item, you just need to know its HTML div id. This example removes the WordPress logo and menu.  See <a href="http://codex.wordpress.org/Function_Reference/remove_node" title="remove_node @ WP Codex">remove_node()</a>.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #666666; font-style: italic;">/*
** The following removes the WordPress menu and logo
** wp-admin-bar-wp-logo is the div id in the menu HTML but we just use wp-logo 
** see http://codex.wordpress.org/Function_Reference/remove_node
*/</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> admin_bar_remove_this<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
     <span style="color: #000000; font-weight: bold;">global</span> <span style="color: #000088;">$wp_admin_bar</span><span style="color: #339933;">;</span>
     <span style="color: #000088;">$wp_admin_bar</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">remove_node</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'wp-logo'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
     <span style="color: #009900;">&#125;</span>
     add_action<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'wp_before_admin_bar_render'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'admin_bar_remove_this'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<h4>Adding something to the Admin Bar</h4>
<p>Similarly, you can add a new menu item to an existing HTML div id. Here we are adding a link to create a new category within the +New menu.  See <a href="http://codex.wordpress.org/Function_Reference/add_node" title="add_node @ WP Codex">add_node()</a>.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #666666; font-style: italic;">/*
** The following adds a link item to create a new &quot;Category&quot; within the &quot;+New&quot; menu
** wp-admin-bar-new-content is the div id in the menu HTML but we just use new-content 
** see http://codex.wordpress.org/Function_Reference/add_node
*/</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> admin_bar_add_this<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
     <span style="color: #000000; font-weight: bold;">global</span> <span style="color: #000088;">$wp_admin_bar</span><span style="color: #339933;">;</span>
     <span style="color: #000088;">$newcat</span><span style="color: #339933;">=</span>get_site_url<span style="color: #009900;">&#40;</span> BP_ROOT_BLOG <span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'/wp-admin/edit-tags.php?taxonomy=category'</span><span style="color: #339933;">;</span>
     <span style="color: #000088;">$wp_admin_bar</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">add_node</span><span style="color: #009900;">&#40;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
          <span style="color: #0000ff;">'parent'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'new-content'</span><span style="color: #339933;">,</span>
          <span style="color: #0000ff;">'title'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Category'</span><span style="color: #339933;">,</span>
          <span style="color: #0000ff;">'href'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$newcat</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
     <span style="color: #009900;">&#125;</span>
add_action<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'wp_before_admin_bar_render'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'admin_bar_add_this'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<h4>Make it Easier for Network Users to Create New Blogs</h4>
<p>The BuddyPress dev team has added Notifications and some other BP-specific features to the admin bar, but the link to &#8220;Create a new site&#8221; is still missing as of v. 1.5.3 (UPDATE: actually, this would be a WP issue, not BP; <a href="http://core.trac.wordpress.org/ticket/19862" title="Ticket 19862 @ WP Trac">track this issue here</a>). If you have a very active community, especially one that routinely creates new sites (e.g. a university course blog network), they will notice this absence. To add another complication, BuddyPress redirects wp-signup.php to the network homepage, meaning the default WordPress Network mode method for creating a new site is broken (UPDATE: <a href="http://buddypress.trac.wordpress.org/ticket/3941" title="Ticket 3941 @ BP Trac">track this issue here</a>). Luckily both of these are easy to fix.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #666666; font-style: italic;">/*
** The following adds a link to &quot;Create a new site&quot; under &quot;My Sites&quot; menu
*/</span>
<span style="color: #000000; font-weight: bold;">function</span> admin_bar_create_blog_link<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
     <span style="color: #000000; font-weight: bold;">global</span> <span style="color: #000088;">$wp_admin_bar</span><span style="color: #339933;">;</span>
     <span style="color: #000088;">$create</span><span style="color: #339933;">=</span>get_site_url<span style="color: #009900;">&#40;</span> BP_ROOT_BLOG <span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'/blogs/create/'</span><span style="color: #339933;">;</span>
     <span style="color: #000088;">$wp_admin_bar</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">add_node</span><span style="color: #009900;">&#40;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
          <span style="color: #0000ff;">'parent'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'my-sites'</span><span style="color: #339933;">,</span>
          <span style="color: #0000ff;">'title'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Create a new site'</span><span style="color: #339933;">,</span>
          <span style="color: #0000ff;">'href'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$create</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
add_action<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'wp_before_admin_bar_render'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'admin_bar_create_blog_link'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">/*
** The following fixes the dashboard link for &quot;Create a new site&quot;
** By default, WordPress sends the user to wp-signup.php to create a site
** But wp-signup.php is redirected to the network homepage by BuddyPress as of 3.1+ and 1.5.3+ respectively
** This just filters that core behavior to use the BuddyPress link instead
*/</span>
add_filter<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'wp_signup_location'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'bp_blog_creation_link'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">function</span> bp_blog_creation_link<span style="color: #009900;">&#40;</span><span style="color: #000088;">$old</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
     <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">function_exists</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'bp_include'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
     <span style="color: #b1b100;">return</span> get_site_url<span style="color: #009900;">&#40;</span> BP_ROOT_BLOG <span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'/blogs/create/'</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>Feel free to make additional suggestions in the comments.</p>
]]></content:encoded>
			<wfw:commentRss>http://jeffersonsnewspaper.org/2012/tips-for-using-the-wordpress-admin-bar-with-buddypress/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Creating a Blog Topics Directory in WPMU 2.8 + BuddyPress 1.1</title>
		<link>http://jeffersonsnewspaper.org/2009/creating-a-blog-topics-directory-in-wpmu-2-8-buddypress-1-1/</link>
		<comments>http://jeffersonsnewspaper.org/2009/creating-a-blog-topics-directory-in-wpmu-2-8-buddypress-1-1/#comments</comments>
		<pubDate>Wed, 07 Oct 2009 03:28:12 +0000</pubDate>
		<dc:creator>E. Bell</dc:creator>
				<category><![CDATA[Reference]]></category>
		<category><![CDATA[buddypress]]></category>
		<category><![CDATA[DIY]]></category>
		<category><![CDATA[information architecture]]></category>
		<category><![CDATA[plug-ins]]></category>
		<category><![CDATA[themes]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[wpmu]]></category>

		<guid isPermaLink="false">http://jeffersonsnewspaper.org/?p=557</guid>
		<description><![CDATA[I recently set up an installation of WordPress MultiUser (WPmu) + BuddyPress for the History Department where I work. We have a number of different user groups on the site, including Courses, Workshops, and Projects. Eventually we will also have Personal sites (for students, staff, and faculty in the dept.) and perhaps some small organizations and campus groups. Right now the site is small, so it would be reasonable to manually create and maintain a...]]></description>
			<content:encoded><![CDATA[<p><img src="http://jeffersonsnewspaper.org/wp-content/uploads/2009/10/buddyPress-alt.jpg" alt="buddyPress-alt" title="buddyPress" width="630" height="auto" class="aligncenter size-full wp-image-572" /></p>
<p>I recently set up an installation of <a href="http://mu.wordpress.org/">WordPress MultiUser</a> (WPmu) + <a href="http://buddypress.org/">BuddyPress</a> for the History Department where I work.  We have a number of different user groups on the site, including Courses, Workshops, and Projects.  Eventually we will also have Personal sites (for students, staff, and faculty in the dept.) and perhaps some small organizations and campus groups.  Right now the site is small, so it would be reasonable to manually create and maintain a topical directory.  As the site grows, however, this could become a burden to say the least.  Nobody likes to do that kind of crap &#8211; not even graduate assistants.  So with the help of an outdated plug-in and a couple of tiny hacks, I easily created a directory of Blogs by Topic so I never need to hand code the directory.  Read on to find out how.</p>
<p><span id="more-557"></span></p>
<p>To begin with, I&#8217;m using Deanna Schneider&#8217;s very handy <a title="BlogTopicsForWPMU @ WordPress.org" href="http://wordpress.org/extend/plugins/blog-topics/">Blog Topics For WPMU</a>. Basically, Blog Topics creates a field in the relevant Settings, Registration and BuddyPress areas in which your users choose from a drop-down of admin-defined topics.  They cannot create new topics, they must use the ones you set, so keep that in mind.  The Site Admin can manually set the Topic for any blog at any time; this might be necessary if you already have a handful of blogs on your site (or you could demand that your users do it themselves because this is all about being lazy).  Some users might misfile their site in the wrong category, but you can always go in and edit any blog&#8217;s Topic; they probably won&#8217;t even notice.</p>
<p>You might be wondering why I would write a tutorial for installing a plug-in.  Well, I&#8217;m not sure if the plug-in code has some deprecated elements or if it just doesn&#8217;t play nice with the new BuddyPress theme structure, but it&#8217;s actually a bit more complicated than just installing the plug-in. For whatever reason, the documentation for this plug-in is pretty weak and some of it just doesn&#8217;t seem to work without some tweaks.  That&#8217;s where I come in to sum up my hours of frustration with what now seems like an obvious process.</p>
<p>Here&#8217;s the drill&#8230;</p>
<ol>
<li>Install the plug-in in your wp-content/plugins folder and activate it on your parent site.  The plug-in comes with a nice little widget for your MU child sites, but it won&#8217;t help you here so consider it optional.</li>
<li>Inside the wp-content/plugins/blog-topics directory, you will find the file cets_blog_topics_page.php (a WordPress page template).  Copy this file to the root of your site&#8217;s parent theme file. If you are using BuddyPress 1.1, that means themes/bp-sn-parent.</li>
<li>Now, take that file and mess it all up according to the instructions below.  Unfortunately, in the plug-in&#8217;s current state (v. 0.3.2), the default file just doesn&#8217;t work, but after digging around in the code, I found some functions that work quite nicely and can be easily integrated into your BuddyPress directories.  Again, you will need to save this to the root of your theme.</li>
<li>Create a page called Blog Topics Directory (or whatever) and apply the Blog Topics Page template you just created.
</li>
</ol>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #339933;">&lt;</span> ?php
<span style="color: #666666; font-style: italic;">/*
Template Name: Blog Topics Page
*/</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span>
<span style="color: #339933;">&lt;</span> ?php get_header<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&nbsp;
	<span style="color: #339933;">&lt;</span>div id<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;content&quot;</span> <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;narrowcolumn&quot;</span><span style="color: #339933;">&gt;</span>
&nbsp;
		<span style="color: #339933;">&lt;</span> ?php do_action<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'bp_before_directory_blogs_content'</span> <span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&nbsp;
		<span style="color: #339933;">&lt;</span>div <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;page&quot;</span> id<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;blog-page&quot;</span><span style="color: #339933;">&gt;</span>
&nbsp;
			<span style="color: #339933;">&lt;</span> ?php <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>have_posts<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> <span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span>have_posts<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> the_post<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&nbsp;
				<span style="color: #339933;">&lt;</span>h2 <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;pagetitle&quot;</span><span style="color: #339933;">&gt;&lt;</span> ?php the_title<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span><span style="color: #339933;">&lt;/</span>h2<span style="color: #339933;">&gt;</span>
&nbsp;
                                <span style="color: #339933;">&lt;!--</span>using anchors <span style="color: #b1b100;">for</span> long lists<span style="color: #339933;">,</span> or you could <span style="color: #000000; font-weight: bold;">use</span> something fancier to browse topics<span style="color: #339933;">--&gt;</span>
&nbsp;
					<span style="color: #339933;">&lt;</span>ul id<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;topic-list&quot;</span><span style="color: #339933;">&gt;</span>
					<span style="color: #339933;">&lt;</span>li<span style="color: #339933;">&gt;&lt;</span>a href<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;#topic1&quot;</span><span style="color: #339933;">&gt;</span>Topic <span style="color: #cc66cc;">1</span><span style="color: #339933;">&lt;/</span>a<span style="color: #339933;">&gt;&lt;/</span>li<span style="color: #339933;">&gt;</span>
					<span style="color: #339933;">&lt;</span>li<span style="color: #339933;">&gt;&lt;</span>a href<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;#topic2&quot;</span><span style="color: #339933;">&gt;</span>Topic <span style="color: #cc66cc;">2</span><span style="color: #339933;">&lt;/</span>a<span style="color: #339933;">&gt;&lt;/</span>li<span style="color: #339933;">&gt;</span>	
					<span style="color: #339933;">&lt;</span>li<span style="color: #339933;">&gt;&lt;</span>a href<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;#topic3&quot;</span><span style="color: #339933;">&gt;</span>Topic <span style="color: #cc66cc;">3</span><span style="color: #339933;">&lt;/</span>a<span style="color: #339933;">&gt;&lt;/</span>li<span style="color: #339933;">&gt;</span>	
					<span style="color: #339933;">&lt;</span>li<span style="color: #339933;">&gt;&lt;</span>a href<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;#topic4&quot;</span><span style="color: #339933;">&gt;</span>Topic <span style="color: #cc66cc;">4</span><span style="color: #339933;">&lt;/</span>a<span style="color: #339933;">&gt;&lt;/</span>li<span style="color: #339933;">&gt;</span>	
					<span style="color: #339933;">&lt;</span>li<span style="color: #339933;">&gt;&lt;</span>a href<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;#topic5&quot;</span><span style="color: #339933;">&gt;</span>Topic <span style="color: #cc66cc;">5</span><span style="color: #339933;">&lt;/</span>a<span style="color: #339933;">&gt;&lt;/</span>li<span style="color: #339933;">&gt;</span>	
					<span style="color: #339933;">&lt;/</span>ul<span style="color: #339933;">&gt;</span>					
&nbsp;
<span style="color: #339933;">&lt;!--</span>add the numeric Topic ID according to the models below<span style="color: #339933;">--&gt;</span>	
&nbsp;
<span style="color: #339933;">&lt;!--</span>topic1<span style="color: #339933;">--&gt;</span>
<span style="color: #339933;">&lt;</span>a name<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;topic1&quot;</span><span style="color: #339933;">&gt;&lt;/</span>a<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>h2 <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;pagetitle&quot;</span><span style="color: #339933;">&gt;&lt;</span> ?php <span style="color: #b1b100;">echo</span> cets_get_topic_name<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'1'</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span> Blogs<span style="color: #339933;">&lt;/</span>h2<span style="color: #339933;">&gt;</span>  
<span style="color: #339933;">&lt;</span> ?php <span style="color: #b1b100;">echo</span> cets_get_blogs_from_topic_id_html<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'1'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&nbsp;
<span style="color: #339933;">&lt;!--</span>topic2<span style="color: #339933;">--&gt;</span>
<span style="color: #339933;">&lt;</span>a name<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;topic2&quot;</span><span style="color: #339933;">&gt;&lt;/</span>a<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>h2 <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;pagetitle&quot;</span><span style="color: #339933;">&gt;&lt;</span> ?php <span style="color: #b1b100;">echo</span> cets_get_topic_name<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'2'</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span> Blogs<span style="color: #339933;">&lt;/</span>h2<span style="color: #339933;">&gt;</span>  
<span style="color: #339933;">&lt;</span> ?php <span style="color: #b1b100;">echo</span> cets_get_blogs_from_topic_id_html<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'2'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&nbsp;
<span style="color: #339933;">&lt;!--</span>topic3<span style="color: #339933;">--&gt;</span>
<span style="color: #339933;">&lt;</span>a name<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;topic3&quot;</span><span style="color: #339933;">&gt;&lt;/</span>a<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>h2 <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;pagetitle&quot;</span><span style="color: #339933;">&gt;&lt;</span> ?php <span style="color: #b1b100;">echo</span> cets_get_topic_name<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'3'</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span> Blogs<span style="color: #339933;">&lt;/</span>h2<span style="color: #339933;">&gt;</span>  
<span style="color: #339933;">&lt;</span> ?php <span style="color: #b1b100;">echo</span> cets_get_blogs_from_topic_id_html<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'3'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&nbsp;
<span style="color: #339933;">&lt;!--</span>topic4<span style="color: #339933;">--&gt;</span>
<span style="color: #339933;">&lt;</span>a name<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;topic4&quot;</span><span style="color: #339933;">&gt;&lt;/</span>a<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>h2 <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;pagetitle&quot;</span><span style="color: #339933;">&gt;&lt;</span> ?php <span style="color: #b1b100;">echo</span> cets_get_topic_name<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'4'</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span> Blogs<span style="color: #339933;">&lt;/</span>h2<span style="color: #339933;">&gt;</span>  
<span style="color: #339933;">&lt;</span> ?php <span style="color: #b1b100;">echo</span> cets_get_blogs_from_topic_id_html<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'4'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&nbsp;
<span style="color: #339933;">&lt;!--</span>topic5<span style="color: #339933;">--&gt;</span>
<span style="color: #339933;">&lt;</span>a name<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;topic5&quot;</span><span style="color: #339933;">&gt;&lt;/</span>a<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>h2 <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;pagetitle&quot;</span><span style="color: #339933;">&gt;&lt;</span> ?php <span style="color: #b1b100;">echo</span> cets_get_topic_name<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'5'</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span> Blogs<span style="color: #339933;">&lt;/</span>h2<span style="color: #339933;">&gt;</span>  
<span style="color: #339933;">&lt;</span> ?php <span style="color: #b1b100;">echo</span> cets_get_blogs_from_topic_id_html<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'5'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&nbsp;
&nbsp;
&nbsp;
&nbsp;
			<span style="color: #339933;">&lt;</span> ?php <span style="color: #b1b100;">endwhile</span><span style="color: #339933;">;</span> <span style="color: #b1b100;">endif</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&nbsp;
		<span style="color: #339933;">&lt;/</span>div<span style="color: #339933;">&gt;</span>
&nbsp;
		<span style="color: #339933;">&lt;</span> ?php do_action<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'bp_after_directory_blogs_content'</span> <span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&nbsp;
	<span style="color: #339933;">&lt;/</span>div<span style="color: #339933;">&gt;</span>
&nbsp;
<span style="color: #339933;">&lt;</span> ?php get_sidebar<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&nbsp;
<span style="color: #339933;">&lt;</span> ?php get_footer<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>You could probably find any number of ways to integrate this into your theme&#8217;s Blog Directory.  Although I might eventually change it, right now, I&#8217;ve just added a link to the Blog Directory sidebar which users can&#8230; use&#8230; to Browse Blogs by Topic.  If it helps, <a title="Cleveland History Blogs" href="http://clevelandhistory.org/">here&#8217;s a link to the site where this code is being used</a>.  Again, it needs some tweaking but this should get you started.  Hope this quick fix has helped.  </p>
<p>If you&#8217;re wondering why this post has a giant image of <a href="http://en.wikipedia.org/wiki/Brak_%28character%29">Brak</a> (among other notable &#8220;buddies&#8221;) at the top, or if you just need a break from all this BuddyPress nonsense, you might need to listen to this&#8230;<br />
<!-- ProPlayer by Isa Goksu --><div name="mediaspace" id="mediaspace"><div class="pro-player-container" width="630px" height="46px"><div id="pro-player-557pp-single-4f3014b05f522"></div></div></div><script type="text/javascript" charset="utf-8">var flashvars = {width: "630",height: "46",autostart: "false",repeat: "false",backcolor: "111111",frontcolor: "cccccc",lightcolor: "66cc00",stretching: "fill",enablejs: "true",mute: "false",skin: "http://jeffersonsnewspaper.org/wp-content/plugins/proplayer/players/skins/default.swf",plugins: "",javascriptid: "557pp-single-4f3014b05f522",image: "",file: 'http://jeffersonsnewspaper.org/wp-content/plugins/proplayer/playlist-controller.php?pp_playlist_id=557pp-single-4f3014b05f522&sid=1328551088'};var params = {wmode: "transparent",allowfullscreen: "true",allowscriptaccess: "always",allownetworking: "all"};var attributes = {id: "obj-pro-player-557pp-single-4f3014b05f522",name: "obj-pro-player-557pp-single-4f3014b05f522"};swfobject.embedSWF("http://jeffersonsnewspaper.org/wp-content/plugins/proplayer/players/player.swf", "pro-player-557pp-single-4f3014b05f522", "630", "46", "9.0.0", false, flashvars, params, attributes);</script></p>
<p align="center"><a href="http://brakbuddy.ytmnd.com/">Brak sings Yeah Buddy (via brakbuddy.ytmnd.com)</a></p>
]]></content:encoded>
			<wfw:commentRss>http://jeffersonsnewspaper.org/2009/creating-a-blog-topics-directory-in-wpmu-2-8-buddypress-1-1/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
<enclosure url="http://content.ytmnd.com/content/9/3/f/93fb525eff749c9e9f82e14ce629bf12.mp3" length="700465" type="audio/mpeg" />
<enclosure url="http://i.cdn.turner.com/adultswim/shows/downloads/shows/brak/mp3/brak_6.mp3" length="192504" type="audio/mpeg" />
		</item>
		<item>
		<title>Building a WordPress Static Homepage with Dynamic Elements</title>
		<link>http://jeffersonsnewspaper.org/2009/building-a-wordpress-static-homepage-with-dynamic-elements/</link>
		<comments>http://jeffersonsnewspaper.org/2009/building-a-wordpress-static-homepage-with-dynamic-elements/#comments</comments>
		<pubDate>Tue, 22 Sep 2009 18:07:30 +0000</pubDate>
		<dc:creator>E. Bell</dc:creator>
				<category><![CDATA[Reference]]></category>
		<category><![CDATA[category feeds]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[dummyproofing]]></category>
		<category><![CDATA[excerpt]]></category>
		<category><![CDATA[external feeds]]></category>
		<category><![CDATA[feeds]]></category>
		<category><![CDATA[omeka]]></category>
		<category><![CDATA[rss]]></category>
		<category><![CDATA[static homepages]]></category>
		<category><![CDATA[theme functions]]></category>
		<category><![CDATA[themes]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://jeffersonsnewspaper.org/?p=421</guid>
		<description><![CDATA[One of the nice features of WordPress is the ability to create static homepages. While most blogs use the standard configuration, where users scroll vertically from the most recent to older blog posts, it often makes sense to use a static homepage instead &#8212; especially if you are looking to create a more professional looking site, or are using WordPress as a Content Management System. I recently tackled a project where we needed to create...]]></description>
			<content:encoded><![CDATA[<p><img src="http://jeffersonsnewspaper.org/wp-content/uploads/2009/09/Manhattan_Bridge_Construction_19091.jpg" width="620px" height="auto"/>One of the nice features of WordPress is the ability to create <a title="Static Homepages @ WP" href="http://codex.wordpress.org/Creating_a_Static_Front_Page">static homepages</a>.  While most blogs use the standard configuration, where users scroll vertically from the most recent to older blog posts, it often makes sense to use a static homepage instead &#8212; especially if you are looking to create a more professional looking site, or are using <a title="WP as CMS @ DevLounge.net" href="http://www.devlounge.net/publishing/things-to-consider-when-using-wordpress-as-a-cms">WordPress as a Content Management System</a>.  I recently tackled a project where we needed to create a static homepage with the following features</p>
<ol>
<li>The homepage needed to look &#8220;homepagey&#8221; (i.e. not &#8220;bloggy&#8221;)</li>
<li>Client needed room for a short introductory text, which could be edited/updated on the fly without disrupting the homepage layout</li>
<li>The homepage needed to highlight the many features on the site, so that users could quickly scan the page, see what the site had to offer, and quickly find the latest update in each area.</li>
</ol>
<p>This quick tutorial will share some code for reproducing something that meets all or some of those criteria.  You don&#8217;t need to know much code to complete this tutorial, but a little helps.  Once you create and implement your homepage template, you will need to use CSS to add styles and adjust the layout.</p>
<p><span id="more-421"></span></p>
<p><strong>The Basics of Creating a Homepage Template</strong></p>
<p>This is pretty well-documented elsewhere, but here&#8217;s what you need to know on the most basic level.  If you are using a prefab theme, find that theme&#8217;s page.php file.  Now take that file and make a copy called homepage.php (or really, whatever you like).  Next, add the five lines below to the very top of the page (before the header and sidebar calls):</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #339933;">&lt;</span> ?php
<span style="color: #666666; font-style: italic;">/*
Template Name: Home Page
*/</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>Now, when you edit or create the page you want to use as Home, you can choose the Home Page template and set it as the static homepage for your site in Settings >> Reading.  But this won&#8217;t get you far.  As is, this template just replicates the behavior of any page on your site.  That&#8217;s not very exciting.  Instead, let&#8217;s try adding some dynamic content to the template.</p>
<p><strong>Note on custom theme_excerpt() function used below</strong></p>
<p>Before you get all crazy and just copy-paste from the homepage code below, note that I am using a custom function to generate post excerpts. To use that function you must first create a file called functions.php and add the following code:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #339933;">&lt;</span> ?php
<span style="color: #000000; font-weight: bold;">function</span> theme_excerpt<span style="color: #009900;">&#40;</span><span style="color: #000088;">$num</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">global</span> <span style="color: #000088;">$more</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$more</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$link</span> <span style="color: #339933;">=</span> get_permalink<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$limit</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$num</span><span style="color: #339933;">+</span><span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$excerpt</span> <span style="color: #339933;">=</span> <span style="color: #990000;">explode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">' '</span><span style="color: #339933;">,</span> <span style="color: #990000;">strip_tags</span><span style="color: #009900;">&#40;</span>get_the_content<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$limit</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #990000;">array_pop</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$excerpt</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$excerpt</span> <span style="color: #339933;">=</span> <span style="color: #990000;">implode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot; &quot;</span><span style="color: #339933;">,</span><span style="color: #000088;">$excerpt</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'...'</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$excerpt</span> <span style="color: #339933;">=</span> <span style="color: #990000;">preg_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'`\[[^\]]*\]`'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">''</span><span style="color: #339933;">,</span><span style="color: #000088;">$excerpt</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;p&gt;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$excerpt</span><span style="color: #339933;">.</span><span style="color: #0000ff;">''</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$more</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>This will get you a more flexible excerpt function than the default WordPress one, <code>the_excerpt()</code>.  I think I stole this from the <a href="http://bavotasan.com/downloads/feed-me-seymour-free-wordpress-theme/" title="FMS theme">Feed Me Seymour theme</a>. You can call the function with <code>theme_excerpt(n)</code> where <em>n</em> is the number of words in the excerpt.</p>
<p><em>I&#8217;m going to break this up into sections, so if you are copy-pasting, you will need to copy all the sections below or pick and choose carefully, otherwise you might end up with some unclosed tags.</em></p>
<p><strong>Preserving the Page text</strong><br />
Most of the text in a dynamic homepage is generated from feeds, posts, and database queries (i.e. not by adding it manually to the page called Home in your WordPress page list).  In some cases, your Home page could be totally blank when accessed from the default page editor.  However, you may want to give yourself the option of manually adding and updating text somewhere on your homepage.  In the example below, we keep the WordPress page text intact by calling <a href="http://codex.wordpress.org/The_Loop" title="The Loop @ WP">The Loop</a>.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #339933;">&lt;</span> ?php
<span style="color: #666666; font-style: italic;">/*
Template Name: Home Page
*/</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span>
<span style="color: #339933;">&lt;!--</span> get the <span style="color: #990000;">header</span> and sidebar<span style="color: #339933;">...</span> though sometimes you might want to leave the sidebar out of a Home template<span style="color: #339933;">.</span>  It<span style="color: #0000ff;">'s here just for the sake of illustration--&gt; 
&lt; ?php get_header(); ?&gt;
&lt; ?php get_sidebar(); ?&gt;
&nbsp;
&lt;div id=&quot;content&quot;&gt;
&nbsp;
&lt;!-- Homepage text from the page editor using '</span>The Loop<span style="color: #0000ff;">'--&gt;
         &lt; ?php if (have_posts()) : while (have_posts()) : the_post(); ?&gt;
		&lt;div class=&quot;post&quot; id=&quot;main-entry&quot;&gt;&lt;div id=&quot;in-border&quot;&gt;
&nbsp;
			&lt;div class=&quot;entry&quot;&gt;
				&lt; ?php the_content(); ?&gt;
			&lt;/div&gt;
				  &lt; ?php endwhile; endif; ?&gt;
		&lt;/div&gt;&lt;/div&gt;
&lt;/div&gt;</span></pre></div></div>

<p><strong>An Internal Category Feed</strong><br />
Below we have the latest one post from the &#8216;News&#8217; category.  You can repeat this with other categories as needed.  This is especially useful if you use the <a href="http://http://wordpress.org/extend/plugins/category-visibility-ipeat/" title="Category Visibility plug-in">Category Visibility plug-in</a> or some other means to hide/show certain category posts in certain areas of your site.  In a recent project, for example, we created additional page templates for displaying posts in certain categories (Calendar Events, Timeline Events, Lesson Plans), but excluded them from the blog loop.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">&lt;!-- An internal feed.--&gt;
&lt;!-- The latest one post from the 'News' category --&gt;
&lt;!-- You can repeat this with other categories as needed.  --&gt;
&nbsp;
&nbsp;
&lt;li&gt;
&lt;h2&gt;News&lt;/h2&gt;
         &lt; ?php $my_query = new WP_Query('category_name=news&amp;showposts=1'); while ($my_query-&gt;have_posts()) : $my_query-&gt;the_post(); $do_not_duplicate = $post-&gt;ID; ?&gt;
&nbsp;
                &lt;!-- Link to the 'News' category --&gt;
    		&lt;div class=&quot;post&quot;&gt;
    		&lt;div id=&quot;link-contain&quot;&gt;
                &lt;p class=&quot;contread&quot;&gt;&lt;a href=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> get_bloginfo<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'url'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>/news&quot;&gt;All News &amp;raquo;&lt;/a&gt;&lt;/p&gt;  
                &lt;/div&gt;
&nbsp;
    		&lt;h3&gt;Latest News&lt;/h3&gt;
&nbsp;
                &lt;!-- The post title --&gt;
		&lt;h3&gt;&lt;a href=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> the_permalink<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; rel=&quot;bookmark&quot; title=&quot;Permanent Link to &lt; ?php the_title(); ?&gt;&quot;&gt;&lt; ?php the_title(); ?&gt;&lt;/a&gt;&lt;/h3&gt;
			&lt;div class=&quot;entry&quot;&gt;
                &lt;!-- The post excerpt using custom function from theme/function.php --&gt;		
				&lt; ?php echo theme_excerpt(30); ?&gt; 
			&lt;/div&gt;
		&lt;/div&gt;
  &lt; ?php endwhile; ?&gt;
&lt;/li&gt;</pre></div></div>

<p><strong>An External Feed</strong><br />
This code uses the WordPress core functionality that brings feeds into your Dashboard.   I&#8217;m just pulling the title and link here, but you can do more.  This is especially useful if your site incorporates another platform besides WordPress.  In the example below, I use a feed from the Omeka platform (<a href="http://omeka.org">omeka.org</a>), which I had tucked into my root directory, masquerading as a native section of the site.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">&lt;!-- An External Feed  --&gt;
&lt;!-- This is especially useful if your site incorporates another platform besides WordPress.--&gt;
&nbsp;
&lt;li&gt;
&lt;h2&gt;Collections &amp;amp; Exhibits &lt;/h2&gt;
    		&lt;div class=&quot;post&quot; id=&quot;omeka-feed&quot;&gt;
    		&lt;div id=&quot;link-contain&quot;&gt;&lt;p class=&quot;contread&quot;&gt;&lt;a href=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> get_bloginfo<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'url'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>/omeka&quot;&gt;View the Archive &amp;raquo;&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;
			&lt;div class=&quot;entry&quot;&gt;
             &lt;!-- This code uses the WordPress core functionality that brings feeds into your Dashboard--&gt;
             &lt;!-- I'm just pulling the title and link here, but you can do more--&gt;
			&lt; ?php  
			require_once (ABSPATH . WPINC . '/rss.php');  
			$rss = @fetch_rss('http://www.myurl.org/omeka/items/browse?output=rss2');  
			if ( isset($rss-&gt;items) &amp;&amp; 0 != count($rss-&gt;items) ) {  
			?&gt;  
			&lt;h3&gt;Latest Additions&lt;/h3&gt;
			&lt;ul&gt;  
			&lt; ?php  
			$rss-&gt;items = array_slice($rss-&gt;items, 0,7);  
			foreach ($rss-&gt;items as $item ) {  
 			?&gt;  
			&lt;li&gt; 
			&lt;a href=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> wp_filter_kses<span style="color: #009900;">&#40;</span><span style="color: #000088;">$item</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'link'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><span style="color: #000000; font-weight: bold;">?&gt;</span>&quot;&gt;
			&lt; ?php echo wp_specialchars($item['title']); ?&gt;  
			&lt;/a&gt;  
			&lt;/li&gt;  
			&lt; ?php } ?&gt;  
			&lt;/ul&gt;  
			&lt; ?php } ?&gt;  
			&lt;/div&gt;
&nbsp;
		&lt;/div&gt;
  &lt; ?php endwhile; ?&gt;
&lt;/li&gt;</pre></div></div>

<p><strong>A Special Plugin Feed (Simple:Press)</strong><br />
Lots of plugins generate their own feed.  Here we have an internal feed from the Simple:Press forum plugin (<a href="http://simplepressforum.com">simplepressforum.com</a>).  Such plug-ins generally use custom functions, such as the one below, the rules for which are defined in the plug-in documentation.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">&lt;!-- An internal feed from the Simple:Press forum plugin (simplepressforum.com)--&gt;
&lt;li&gt;
&lt;h2&gt;Discussions&lt;/h2&gt;
    		&lt;div class=&quot;post&quot; id=&quot;forum-posts&quot;&gt;
    		&lt;div id=&quot;link-contain&quot;&gt;&lt;p class=&quot;contread&quot;&gt;&lt;a href=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> get_bloginfo<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'url'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>/forum&quot;&gt;View Forums &amp;raquo;&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;
			&lt;div class=&quot;entry&quot;&gt;
			&lt;h3&gt;Latest Topics&lt;/h3&gt;
				&lt;ul&gt;
				&lt; ?php sf_recent_posts_tag(3, false, true, true, true, 0, false); ?&gt;
				&lt;/ul&gt;
&nbsp;
			&lt;/div&gt;
&nbsp;
		&lt;/div&gt;
&nbsp;
&lt;/li&gt;</pre></div></div>

<p><strong>Listing all Pages</strong><br />
Normally, you should list all your pages in the header navigation, but in this case I had too many pages to list there, some of which didn&#8217;t belong in the navigation.  I listed only the pages that were not part of the header navigation or the footer (About, Contact) in this section.  You can find more info about <code>wp_list_pages()</code> <a href="http://codex.wordpress.org/Template_Tags/wp_list_pages" title="wp_list_pages() @ WP">here</a>.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #339933;">&lt;!--</span> <span style="color: #990000;">List</span> all parent pages and first level of child pages <span style="color: #339933;">--&gt;</span>
<span style="color: #339933;">&lt;</span>li<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>h2<span style="color: #339933;">&gt;</span>More<span style="color: #339933;">&lt;/</span>h2<span style="color: #339933;">&gt;</span>
&nbsp;
    	<span style="color: #339933;">&lt;</span>div <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;post&quot;</span> id<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;more-list&quot;</span><span style="color: #339933;">&gt;</span>
			<span style="color: #339933;">&lt;</span>ul<span style="color: #339933;">&gt;</span>
			<span style="color: #339933;">&lt;</span>h3<span style="color: #339933;">&gt;&lt;</span> ?php wp_list_pages<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'title_li=&amp;depth=2exclude=1,2,3,4,5,6'</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">;</span><span style="color: #000000; font-weight: bold;">?&gt;</span><span style="color: #339933;">&lt;/</span>h3<span style="color: #339933;">&gt;</span>
			<span style="color: #339933;">&lt;/</span>ul<span style="color: #339933;">&gt;</span>
	<span style="color: #339933;">&lt;/</span>div<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;/</span>li<span style="color: #339933;">&gt;</span></pre></div></div>

<p>If you are copy-pasting, don&#8217;t forget to add the footer to end your page</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #339933;">&lt;</span> ?php get_footer<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>Of course, there are plenty more tricks out there.  Frankly, these aren&#8217;t that special, but they seem fundamental.  If this helps you, let us know in the comments.</p>
]]></content:encoded>
			<wfw:commentRss>http://jeffersonsnewspaper.org/2009/building-a-wordpress-static-homepage-with-dynamic-elements/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

