the template for the search results, search.php, is using the general loop.php which is not distinguishing between posts and pages in the result;
try to edit the style.css to fix the appearance of the search results:
examples:
1 – the ‘read more’ is formatted with a style including the .post
css class which is missing a pages because the theme is using post_class()
for the post div;
edit the style:
.content-bar .post .read_more
{ ...
and change to:
.content-bar .post .read_more, .search .content-bar .page .read_more
{ ...
2 – the section with ‘Category etc’ is output without consideration for pages;
to hide the section, add this to style.css:
.search .page .post_meta { display: none; }
also change:
.content-bar .post { ...
to:
.content-bar .post, .search .content-bar .page { ...
Thank you very much for your prompt response.
I made all the code changes suggested above in the style.css file.
For some reason, it did not change the behavior at all.
What should I try now?
Below are excerpts from the page.php and single.php files. Do you see any problem with the code below?
From page.php
<div class="content-bar">
<?php if (have_posts()) : the_post(); ?>
<?php the_content(); ?>
<?php wp_link_pages(array('before' => '<div class="clear"></div><div class="page-link"><span>' . __('Pages:', 'andrina-lite') . '</span>', 'after' => '</div>')); ?>
<?php endif; ?>
From single.php
<div class="content-bar">
<!-- Start the Loop. -->
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<!--post Start-->
<div class="post">
<h1 class="post_title"><a>" rel="bookmark" title="<?php printf( esc_attr__( 'Permalink to %s', 'andrina-lite' ), the_title_attribute( 'echo=0' ) ); ?>"><?php the_title(); ?></a></h1>
<ul class="post_meta">
<li class="post_date"><?php the_date(); ?>
<li class="post_category"><span>/ <?php _e('Category','andrina-lite'); ?></span> <?php the_category(', '); ?>
<li class="posted_by"><span>/ </span><?php _e('Posted By','andrina-lite'); ?> <?php the_author_posts_link(); ?>
<li class="postc_comment"><span>/ </span> <?php comments_popup_link(__('No Comments.','andrina-lite'), __('1 Comment.','andrina-lite'), __('% Comments.','andrina-lite')); ?>
<div class="post_content"> <?php the_content(); ?>
page.php and single.php are fine, there was never a problem with those templates;
if at all, search.php would be the template to investigate.
however, I can see that the changes have taken effect (Firefox 17) –
don’t forget to clear the browser cache – press ‘ctrl f5’ or ‘reload’ or whatever your broser needs.
Thank you so much for your help. That is exactly what happened.
They just fixed this problem with the version 2.5.3. Yeah! Thanks so much for providing me a fix in the meantime.
I am very disappointed to say that InkThemes DID NOT fix this problem with the 2.5.3 release. I must have tested before clearing my cache 🙁
I have reimplemented the code solution above. I do have a question about best practices. Out of the 3 changes above, I am able to put the following in the custom css,
.search .page .post_meta { display: none; }
but made the other 2 changes directly in the style.css, which will be overwritten with the next theme update. What is the best option?