Hi,
I'm trying to build a front page template that will have a jQuery featured page/post slider, three widget areas and a section that will list the latest three posts from the blog.
But I'm running into trouble. Initially, I had the jQuery gallery called through Functions.php but then I decided to pull that out of functions and put it directly into the page template. So this is what I have in my page template right now.
<?php
/*
Template Name: Front Page
.
Take a look at the functions.php for this theme to see how the random content is included.
.
*/
?>
<?php get_header() ?>
<div id="gallery">
<div id="gallery-container">
<?php dynamic_content_gallery(); ?>
</div><!--leader-contianer-->
</div><!--leader-->
<div id="container">
<div id="content">
<?php
$recentPosts = new WP_Query();
$recentPosts->query('showposts=3');
while ($featuredPosts->have_posts()) : $featuredPosts->the_post(); ?>
<h1><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h1>
<div class="meta">
By <?php the_author() ?>
</div>
<div class="storycontent">
<?php the_excerpt(); ?>
</div>
<?php endwhile; ?>
</div><!-- #content -->
</div><!-- #container -->
<?php get_footer() ?>
The problem is, now nothing is showing up except for the menu, the blog title and blog description (the CSS is still being worked on so it doesn't look pretty right now and may not work all that great, yet)
Here is what it looks like: http://www.ctrchurch.com/test
I have pulled the code for the three widget areas out of the Thematic Powerblog child theme.
This is what I have in Functions.php
// Register new widgetized areaa and the new widgets
function childtheme_widgets_init() {
register_sidebar(array(
'name' => '1st leader Aside',
'id' => '1st-leader-aside',
'before_widget' => '<li id="%1$s" class="widgetcontainer %2$s">',
'after_widget' => "</li>",
'before_title' => "<h3 class=\"widgettitle\">",
'after_title' => "</h3>\n",
));
register_sidebar(array(
'name' => '2nd leader Aside',
'id' => '2nd-leader-aside',
'before_widget' => '<li id="%1$s" class="widgetcontainer %2$s">',
'after_widget' => "</li>",
'before_title' => "<h3 class=\"widgettitle\">",
'after_title' => "</h3>\n",
));
register_sidebar(array(
'name' => '3rd leader Aside',
'id' => '3rd-leader-aside',
'before_widget' => '<li id="%1$s" class="widgetcontainer %2$s">',
'after_widget' => "</li>",
'before_title' => "<h3 class=\"widgettitle\">",
'after_title' => "</h3>\n",
));
// Register the new widgets
register_sidebar_widget('Thematic Power Blog Subscribe', 'thematic_power_blog_subscribe');
}
add_action( 'init', 'childtheme_widgets_init' );
// Add a widgetized aside just below the main content
function childtheme_leaderasides() { ?>
<?php if (is_page_template('front-page.php')) { ?>
<?php if ( is_sidebar_active('1st-leader-aside') || is_sidebar_active('2nd-leader-aside') || is_sidebar_active('3rd-leader-aside') ) { // one of the leader asides has a widget ?>
<div id="notice">
<div id="notice-container">
<?php if ( function_exists('dynamic_sidebar') && is_sidebar_active('1st-leader-aside') ) { // there are active widgets for this aside
echo '<div id="first-leader" class="aside sub-aside">'. "\n" . '<ul class="xoxo">' . "\n";
dynamic_sidebar('1st-leader-aside');
echo '</ul>' . "\n" . '</div><!-- #first-leader .aside -->'. "\n";
} ?>
<?php if ( function_exists('dynamic_sidebar') && is_sidebar_active('2nd-leader-aside') ) { // there are active widgets for this aside
echo '<div id="second-leader" class="aside sub-aside">'. "\n" . '<ul class="xoxo">' . "\n";
dynamic_sidebar('2nd-leader-aside');
echo '</ul>' . "\n" . '</div><!-- #second-leader .aside -->'. "\n";
} ?>
<?php if ( function_exists('dynamic_sidebar') && is_sidebar_active('3rd-leader-aside') ) { // there are active widgets for this aside
echo '<div id="third-leader" class="aside sub-aside">'. "\n" . '<ul class="xoxo">' . "\n";
dynamic_sidebar('3rd-leader-aside');
echo '</ul>' . "\n" . '</div><!-- #third-leader .aside -->'. "\n";
} ?>
</div><!-- #leader-container -->
</div><!-- #leader -->
<?php } ?>
<?php } }
add_action('thematic_abovefooter','childtheme_leaderasides',6);
So why are none of these three elements showing up now?
Oh, and now the footer isn't showing up.
Gah! I keep breaking this!