Forums › Forums › Search & Filter Pro › Please help to fix the error
- This topic has 1 reply, 2 voices, and was last updated 7 years, 1 month ago by Trevor.
Viewing 2 posts - 1 through 2 (of 2 total)
-
Anonymous(Private) September 26, 2017 at 6:21 am #133001
Hi!
<?php if ( $query->have_posts() ) { ?> <div style="width: 100%;">Найдено <?php echo $query->found_posts; ?> Результатов<br /> <div class="pagination"> <div class="nav-previous"><?php next_posts_link( 'Еще результаты', $query->max_num_pages ); ?></div> <div class="nav-next"><?php previous_posts_link( 'Прошлые результаты' ); ?></div> </div> </div> <?php $column_count = 0; while ($query->have_posts()) { $query->the_post(); ?> <div class="one_third" style="margin-right: 0px;"> <?php if ( has_post_thumbnail()) { ?> <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>" > <?php the_post_thumbnail(); ?></a><?php } ?> <h4><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h4> </div> <?php $column_count ++; ?> } } <?php else {echo "Ничего не найдено";} ?>
Parse error: syntax error, unexpected ‘else’ (T_ELSE) in /home/sobaka-pav/dk-moskvor.ru/docs/wp-content/themes/Divi/search-filter/results.php on line 33
Trevor(Private) September 26, 2017 at 12:16 pm #133121Is this better:
<?php if ( $query->have_posts() ) { ?> <div style="width: 100%;">Найдено <?php echo $query->found_posts; ?> Результатов<br /> <div class="pagination"> <div class="nav-previous"><?php next_posts_link( 'Еще результаты', $query->max_num_pages ); ?></div> <div class="nav-next"><?php previous_posts_link( 'Прошлые результаты' ); ?></div> </div> </div> <?php $column_count = 0; while ($query->have_posts()) { $query->the_post(); ?> <div class="one_third" style="margin-right: 0px;"> <?php if ( has_post_thumbnail()) { ?> <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>" > <?php the_post_thumbnail(); ?></a><?php } ?> <h4><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h4> </div> <?php $column_count ++; } } else {echo "Ничего не найдено";} ?>
-
AuthorPosts
Viewing 2 posts - 1 through 2 (of 2 total)