Hi, i love my theme but i want to exclude part of it when users go to other pages. At the moment it has a Featured News and Popular articles section on the Homepage which looks great but i dont want it on my other pages.
Here is the page code:
<---------start--------->
<?php get_header(); ?>
<!-- BEGIN home -->
<div id="home">
<!-- BEGIN featured -->
<div id="featured">
<h2>Featured News</h2>
<?php
$temp_query = $wp_query;
query_posts(array('post__in'=>array(dp_settings('featured'))));
if (have_posts()) : the_post();
?>
<div class="content">
<?php dp_attachment_image(0, 'thumbnail', 'alt="' . $post->post_title . '"'); ?>
<h3>"><?php the_title(); ?></h3>
<p class="date"><?php the_time('l, F j, Y') ?></p>
<?php ob_start(); the_content(''); echo str_replace("\n", '
', (dp_clean(ob_get_clean(), 700))); ?>
</div>
<div class="details">
" class="readmore">Read More »
<p class="r">Filed Under: <?php the_category(', ') ?> <span class="comments"><?php comments_popup_link('No Comments', '1 Comment', '% Comments'); ?></span></p>
</div>
<?php endif; ?>
</div>
<!-- END featured -->
<!-- BEGIN popular -->
<div id="popular">
<h2>Popular Articles</h2>
-
<?php dp_popular_posts(7); ?>
</div><div class="break"></div>
<!-- END popular -->
</div>
<!-- END home -->
<!-- BEGIN content -->
<div id="content">
<?php
$wp_query = $temp_query;
if (have_posts()) : the_post();
$arc_year = get_the_time('Y');
$arc_month = get_the_time('m');
$arc_day = get_the_time('d');
?>
<!-- begin post -->
<div class="single">
<h2>"><?php the_title(); ?></h2>
<?php the_content(); ?>
<div class="details">
<p class="l">Categories: <?php the_category(', ') ?></p>
<?php the_tags( '<p class="r">Tags: ', ', ', '</p>'); ?>
<div class="break"></div>
</div>
</div>
<!-- end post -->
<div id="comments"><?php comments_template(); ?></div>
<?php else : ?>
<div class="notfound">
<h2>Not Found</h2>
<p>Sorry, but you are looking for something that is not here.</p>
</div>
<?php endif; ?>
</div>
<!-- END content -->
<?php get_sidebar(); get_footer(); ?>
<---------END--------->
When i try and remove the featured & popular code it comes up with a fatal error which is....
Fatal error: Call to a member function on a non-object in /home/sites/eventindustrynews.co.uk/public_html/wp-includes/query.php on line 320
Any help would be great!