Toom Morel Pro Theme

Show Recent Blog Posts on Static Homepage with WordPress Toom Morel Pro by InkThemes

Our post about how to Show Blog Posts on Static Homepage with WordPress Thesis Theme has garnered a lot of  responses, even some from folks who don’t use Thesis, but want to display recent posts on the homepages for their other themes.  Since not all themes are as easily customized as Thesis, implementing this functionality can be a little more involved.  However, it’s still pretty straightforward.

This post will detail how to customize your Toom Morel Pro theme to display content in one of the Feature Content areas on the homepage:

1.  Edit front-page.php by logging into WordPress admin and going to Appearance > Editor.  Then select front-page.php from the list on the right.

2.  The code for the Feature Content boxes starts at line 218 in front-page.php.  Locate the Feature Content box (1, 2, 3, or 4) that you want to show the recent posts in by looking for the following code after line 218:

<div class="circle">NUMBER_OF_FEATURE_BOX_YOU_WANT_TO_EDIT</code></div>

3. Three lines below the above code, you will see an else statement that looks something like:

else { ?>Our Clients <?php } ?></h3>

Replace “Our Clients” with whatever you want the title of your Feature Content box to be e.g. Recent Posts.

4. Two lines below the else statement, you will see something along the lines of:

<p><?php if ( get_option('inkthemes_feature3') !='' ) { echo stripslashes(get_option('inkthemes_feature3')); }
			else { ?>Anonymous Hacks NATO, Hackers Deface Anonymous Site Tablet Sales Show Hope for Microsoft Google Announces AdWords Business Credit Card for Public.<?php } ?></p>

5. Delete everything between the <p></p> tags.

6. Insert the following code between the <p></p> tags:

<div id="my-static-front-posts">
$custom_loop = new WP_Query('showposts=1&amp;amp;amp;orderby=date');
if ( $custom_loop->have_posts() ) :
while ( $custom_loop->have_posts() ) : $custom_loop->the_post();
echo '<div class="post type-post hentry post_box top">';
echo '<div class="headline_area"><b><a href="' . get_permalink() . '">' . get_the_title() . '</a></b>';
echo '<p class="headline_meta"><abbr title="" class="published">' . get_the_date() . '</abbr></p></div>';
echo '<div class="format_text entry-content"><p>' . get_the_excerpt() . '</p></div>';
echo '<a href="' . get_permalink() . '">' . '<span class="more-button">Read More</span></a>';
echo '</div>';

7. Save front-page.php and check out your site. You should see the most recent post being displayed in the appropriate Feature Content area. The above code can be modified to customize how feature posts are displayed.

Leave a Reply

Your email address will not be published. Required fields are marked *