Jump to content

WordPress. Результаты поиска


Recommended Posts

  • VIP

Здравствуйте!

Вот так отображаются фильмы на главное странице и категориях (index.php и archive.php ) WP:

1391963425-clip-153kb.jpg

 

Но при результатах поиска, записи отображаться следующим образом:

1391963628-clip-90kb.jpg

 

Содержимое файлов index.php, archive.php и search.php одинаковое! Почему тогда при результат поиска нет картинки и весь текст в куче?

На сайте установлена тема "audi gtr fleximag".

Link to post
Share on other sites
  • VIP

Выложите содержимое archive.php и search.php - так станет понятнее

<?php get_header(); ?>
<div class="art-content-layout">
    <div class="art-content-layout-row">
<?php include (TEMPLATEPATH . '/sidebar1.php'); ?><div class="art-layout-cell art-content">

<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
<div class="art-post">
    <div class="art-post-tl"></div>
    <div class="art-post-tr"></div>
    <div class="art-post-bl"></div>
    <div class="art-post-br"></div>
    <div class="art-post-tc"></div>
    <div class="art-post-bc"></div>
    <div class="art-post-cl"></div>
    <div class="art-post-cr"></div>
    <div class="art-post-cc"></div>
    <div class="art-post-body">
<div class="art-post-inner art-article">
<?php $page_title = get_post_meta($post->ID, 'page_title', TRUE); ?>
<?php if (!$page_title == 'No') { ?>
<h2 class="art-postheader">
<a href="<?php the_permalink() ?>" rel="bookmark" title="<?php printf(__('Permanent Link to %s', 'kubrick'), the_title_attribute('echo=0')); ?>">
<?php the_title(); ?>
</a>
</h2>
 <?php } ?>
<?php $icons = array(); ?>
<?php if (!is_page()): ?>

<?php endif; ?>
<div class="art-postcontent">
    <!-- article-content -->

          <?php if (is_search()) the_excerpt(); else the_content(__('')); ?>
          <?php if (is_page() or is_single()) wp_link_pages(array('before' => '<p><strong>Pages:</strong> ', 'after' => '</p>', 'next_or_number' => 'number')); ?>
    <div class="morelink"><a href="<?php the_permalink() ?>"><span style="color: #000000;"><strong>Смотреть онлайн</strong></span></a></div>
    <!-- /article-content -->
</div>
<div class="cleared"></div>
<?php ob_start(); ?>
<?php $icons = array(); ?>
<?php if (!is_page()): ?><?php ob_start(); ?><?php printf(__('Posted in %s', 'kubrick'), get_the_category_list(', ')); ?>
<?php $icons[] = ob_get_clean(); ?><?php endif; ?><?php if (!is_page() && get_the_tags()): ?><?php ob_start(); ?><?php the_tags(__('Tags:', 'kubrick') . ' ', ', ', ' '); ?>
<?php $icons[] = ob_get_clean(); ?><?php endif; ?><?php if (!is_page() && !is_single()): ?><?php ob_start(); ?><?php comments_popup_link(__('No Comments »', 'kubrick'), __('1 Comment »', 'kubrick'), __('% Comments »', 'kubrick'), '', __('Comments Closed', 'kubrick') ); ?>
<?php $icons[] = ob_get_clean(); ?><?php endif; ?><?php if (0 != count($icons)): ?>
<div class="art-postfootericons art-metadata-icons">
<?php echo implode(' | ', $icons); ?>

</div>
<?php endif; ?>
<?php $metadataContent = ob_get_clean(); ?>
<?php if (trim($metadataContent) != ''): ?>

<?php endif; ?>

</div>

		<div class="cleared"></div>
    </div>
</div>

<?php endwhile; ?>
<?php
$prev_link = get_previous_posts_link(__('Newer Entries »', 'kubrick'));
$next_link = get_next_posts_link(__('« Older Entries', 'kubrick'));
?>
<?php if ($prev_link || $next_link): ?>
<div class="art-post">
    <div class="art-post-tl"></div>
    <div class="art-post-tr"></div>
    <div class="art-post-bl"></div>
    <div class="art-post-br"></div>
    <div class="art-post-tc"></div>
    <div class="art-post-bc"></div>
    <div class="art-post-cl"></div>
    <div class="art-post-cr"></div>
    <div class="art-post-cc"></div>
    <div class="art-post-body">
<div class="art-post-inner art-article">

<div class="art-postcontent">
    <!-- article-content -->

<div class="pagenavi">
      <?php if(function_exists('wp_pagenavi')) { ?>
 <div class="wp-pagenavi">
   <?php wp_pagenavi();  ?>
 </div>
 <?php }
else {?>
 <div class="page-nav">
   <div class="nav-previous">
     <?php previous_posts_link('Предыдущая') ?>
   </div>
   <div class="nav-next">
     <?php next_posts_link('Следующая') ?>
   </div>
 </div>
 <? } ?>
 </div>

    <!-- /article-content -->
</div>
<div class="cleared"></div>


</div>

		<div class="cleared"></div>
    </div>
</div>

<?php endif; ?>
<?php else : ?>
<h2 class="center"><?php _e('Not Found', 'kubrick'); ?></h2>
<p class="center"><?php _e('Sorry, but you are looking for something that isn’t here.', 'kubrick'); ?></p>
<?php if(function_exists('get_search_form')) get_search_form(); ?>
<?php endif; ?>

</div>
<?php include (TEMPLATEPATH . '/sidebar2.php'); ?>
    </div>
</div>
<div class="cleared"></div>

<?php get_footer(); ?>

Вот такой вид на данный момент у index.php, archive.php и search.php

Link to post
Share on other sites

<?php if (is_search()) the_excerpt(); else the_content(__('')); ?>
<?php if (is_page() or is_single()) wp_link_pages(array('before' => '<p><strong>Pages:</strong> ', 'after' => '</p>', 'next_or_number' => 'number')); ?>

 

В этих строках косяк

Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...