I see at least two potential issues:
- You have
if ( have_posts() ) :
twice.
Here:
<?php if ( have_posts() ) : ?>
<h1 class="page-title"><?php printf( __( 'Search Results for: %s', 'nothing' ), '' . get_search_query() . '' ); ?></h1>
And here:
<ul id="post-list">
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
-
The
get_template_part()
template tag expects a filename slug, rather than a path. So you may want to use thelocate_template()
template tag instead for these:
Try:
<?php locate_template( 'includes/inc-image.php' ); ?>
<?php locate_template( 'includes/inc-detail.php' ); ?>
EDIT
The locate_template doesn’t load any content when i apply that…
Do those files exist?
…and removing one of the if gives me an unexpected T_ELSEIF error… 🙁
Yeah, because you have an improperly opened/closed else/if
construct. Get rid of the stray endif
here:
<?php get_template_part( 'includes/inc-image' ); ?>
<?php endif; ?>
EDIT 2
So, here’s a rewrite, attempted to fix your syntax errors:
<?php get_header(); ?>
<h1 class="page-title"><?php printf( __( 'Search Results for: %s', 'nothing' ), '' . get_search_query() . '' ); ?></h1>
<?php if ( have_posts() ) : ?>
<ul id="post-list">
<?php while (have_posts()) : the_post(); ?>
<?php
$featured = get_post_meta($post->ID,'_thumbnail_id',true);
$attachments = get_children( 'post_type=attachment&orderby=menu_order&exclude=".$featured."&post_mime_type=image&post_parent=".$post->ID );
$vimeo = get_post_meta($post->ID, "rw_post-vimeo',true);
?>
<li class="post">
<span class="entry-published">
<time datetime="<?php the_time('Y-m-d')?>"><?php the_time('F jS, Y') ?></time>
<!--Start Single Image-->
<?php get_template_part( 'includes/inc-image' ); ?>
<!--End Single Image-->
<!--Start Rest Of Post Content-->
<?php get_template_part( 'includes/inc-detail' ); ?>
<!--End Rest Of Post Content-->
</li>
<?php endwhile; ?>
</ul>
<section id="pagination">
<?php wp_pagenavi(); ?>
</section>
<?php else : ?>
<h2><?php _e( 'Nothing Found', 'nothing' ); ?></h2>
<p><?php _e( 'Sorry, but nothing matched your search criteria. Please try again with some different keywords.', 'twentyten' ); ?></p>
<?php get_search_form(); ?>
<?php endif; ?>
<?php get_footer(); ?>
Verify that works, and then we’ll tackle the template-part output issues.