Add Recent Comments to Branford Magazine Theme

October 7, 2008 · Filed Under web site building 

Branford Magazine theme is simply one of the most elegant free premium magazine-style Wordpress themes. One of the reasons I love it is the tabbed options box so prominently located right above the first post that webmasters  can customize to their liking. For one of my sites it was important to display the most recent comments prominently, and after a lot of research and tweaking, this is the code I used to achieve this.

Here is the code for editing the ui.tabs.php to include recent comments:

<!– START TABBED SECTION –>

<div id=”container-4″>
<ul>
<li><a class=”ui-tabs” href=”#fragment-1″>Lead Article</a></li>
<li><a class=”ui-tabs” href=”#fragment-2″>Recent</a></li>
<li><a class=”ui-tabs” href=”#fragment-3″>Comments</a></li>
<!– Just add tabs as you like by following this scheme:
<li><a class=”ui-tabs” href=”#fragment-X”>Link name here</a></li> –>
</ul>
<!– LEAD ARTICLE –>
<div id=”fragment-1″>
<ul id=”leadarticle”>
<?php
// Lead Story module begins
query_posts(’showposts=1&cat=1′); //selects 1 article of the category with ID 1 ?>
<?php while (have_posts()) : the_post(); ?>
<a href=”<?php the_permalink() ?>” rel=”bookmark” title=”Permanent Link to <?php the_title(); ?>”><img src=”<?php bloginfo(’url’); echo ‘/’; echo get_option(’upload_path’); echo ‘/’;
// this is where the Lead Story image gets printed
$values = get_post_custom_values(”leadimage”); echo $values[0]; ?>” alt=”leadimage” id=”leadpic” /></a>
<h3>
<?php
// this is where the name of the Lead Story category gets printed
wp_list_categories(’include=1&title_li=&style=none’); ?>
</h3>
<a href=”<?php the_permalink() ?>” rel=”bookmark” title=”<?php __(’Permanent Link to’,'branfordmagazine’)?> <?php the_title(); ?>” class=”title”>
<?php
// this is where the title of the Lead Story gets printed
the_title(); ?>
</a>
<?php
// this is where the excerpt of the Lead Story gets printed
the_excerpt() ; ?>
<?php endwhile; ?>
</ul>
</div>
<!– END LEAD ARTICLE –>
<!– RECENT POSTS –>
<div id=”fragment-2″ class=”bullets”>
<h3 class=”title”>Recent Posts</h3>
<?php wp_get_archives(’type=postbypost&limit=10′); ?>
</div>
<!– END RECENT POSTS –>
<!– RECENT COMMENTS–>
<div id=”fragment-3″ class=”bullets”>
<h3 class=”title”>Comments</h3>
<?php get_recent_comments(); ?>
</div>
<!– END RECENT COMMENTS–>
</div>
<!– END TABBED SECTION –>

I scoured the web for information on this, including the theme support forums, as well as the wordpress support forums, but could not find any tutorials. After 12 hours of trial and error, I was able to get it right.

You will have to try this code at your own risk, so to play safe, make a backup copy of your original ui.tabs.php file so you can restore it to the original.

A screenshot (of one of my sites, Baguio Insider, that used this theme) of the results has been included to prove to you that it does work, although I must say that adding another #fragment-X has cause my page to break up.

Comments

2 Responses to “Add Recent Comments to Branford Magazine Theme”

  1. JP on June 10th, 2009 11:10 am

    I just noticed you have replaced the Branford leadimage with a video at http://www.i-baguio.com/. That is exactly what I’m trying to do. Can you tell me how you did it?

    Thanks,

    JP

  2. lisa on June 16th, 2009 11:32 pm

    Hi JP, the wordpress template I am currently using for the site is revolution church. I edit sidebar.php and embed the YouTube video code.

    You can do this with any part of your site. Just figure out which part of the code refers to which part of your site and experiment. But please create a backup of your original file before making any changes so you can restore it to the original.

    Hope this helps.

    :)

Leave a Reply