Jump to content
Sign in to follow this  
dgil007

How to display full post content on search results?

Recommended Posts

dgil007

Hi, can you tell me how to get full post contents to display on search results pages. At the moment it just displays the post titles, excerpt line and the following code "document.write(String.fromCharCode(60,112,62,60,105,109,103,32,97,108,116,61,34,119,97,108,10". You can see an example at http://ipadhdwallpaper.com/?s=mac Thanks, D

Share this post


Link to post
Share on other sites
Andrew

Don't know where the code is coming from, my thought is that its from a plugin. The interface for what is shown on search pages is controlled by the `_posts.php` file and the conditional `is_search()`

Share this post


Link to post
Share on other sites
dgil007

I have tried switching off all plugins, but still no full content on the search results. I don't seem to have an interface for controlling what is shown on search pages. Where should it be located? I have searched the _posts.php file but it does not contain a conditional "is_search()". The full code from my _posts.php file is below. Could you tell me if it is missing anything? Thanks _posts.php : <?php if (!is_404() && have_posts()) : while (have_posts()) : the_post(); ?> <?php if(is_single()):?> <div class="post-nav"> <span class="previous"><?php previous_post_link('%link') ?></span> <span class="next"><?php next_post_link('%link') ?></span></div> <?php endif;?> <div class="postwrap fix"> <div <?php post_class() ?> id="post-<?php the_ID(); ?>"> <?php if(!is_page()):?> <div class="copy fix"> <?php if(pl_show_thumb($post->ID)): ?> <div class="thumb left"> " rel="bookmark" title="<?php _e('Permanent Link To', TDOMAIN);?> <?php the_title_attribute();?>"> <?php the_post_thumbnail('thumbnail');?> </div> <?php elseif (get_post_meta($post->ID, 'thumb', true)): ?> <?php $postimageurl = get_post_meta($post->ID, 'thumb', true); ?> <div class="thumb left"> " rel="bookmark" title="<?php _e('Permanent Link To', TDOMAIN);?> <?php the_title_attribute();?>"> " alt="Post Pic" width="200" height="200" /> </div> <?php endif; ?> <div class="post-header fix <?php if(!pl_show_thumb($post->ID) && !get_post_meta($post->ID, 'thumb', true)) echo 'post-nothumb';?>"> <div class="post-title-section fix"> <div class="post-title fix"> <h2>" rel="bookmark" title="<?php _e('Permanent Link to',TDOMAIN);?> <?php the_title_attribute(); ?>"><?php the_title(); ?></h2> <div class="metabar"> <?php _e('On',TDOMAIN);?> <?php the_time(get_option('date_format')); ?>, <?php _e('in',TDOMAIN);?> <?php the_category(', ') ?>, <?php _e('by',TDOMAIN);?> <?php the_author(); ?> <?php edit_post_link(__('(Edit Post)', TDOMAIN), ' ', ' ');?> </div> </div> </div> <!--/post-title --> <?php if(pl_show_excerpt($post->ID)):?> <div class="post-excerpt"> <?php the_excerpt(); ?> </div> <?php endif; ?> </div> </div> <?php endif;?> <?php if(pl_show_content($post->ID) || is_category()):?> <div class="copy fix"> <?php if(pagelines('pagetitles') && is_page() || is_page_template('page-feature-blog.php')):?> <h1 class="pagetitle"><?php the_title(); ?></h1> <?php endif;?> <div class="textcontent"> <?php the_content(__('<p>Continue reading »</p>',TDOMAIN)); ?> <?php link_pages(__('<p>Pages:', TDOMAIN), '</p>', __('number', TDOMAIN)); ?> <?php edit_post_link(__('Edit',TDOMAIN), '<p>', '</p>'); ?> </div> </div> <?php if(pagelines('authorinfo') && is_single()):?> <?php include(THEME_LIB.'/_authorinfo.php');?> <?php endif;?> <?php endif;?> <?php if(!is_page()) include(THEME_LIB.'/_post_footer.php');?> </div><!--post --> </div> <?php if(!is_page()):?> <div class="tags"> <?php the_tags(__('Tagged with: ', TDOMAIN),' • ',''); ?> </div> <?php endif;?> <div class="clear"></div> <?php if(is_single() || is_page()):?> <?php include(THEME_LIB."/_contentsidebar.php");?> <?php if(!is_page() || (is_page() && pagelines('pagecomments', $post->ID))) include(THEME_LIB.'/_commentsform.php');?> <?php endif; endwhile; ?> <?php include(THEME_LIB.'/_pagination.php');?> <?php else : ?> <div class="postwrap fix"> <div class="hentry"> <div class="billboard"> <?php if(is_404()):?> <h2 class="center"><?php _e('Error 404 - Page Not Found',TDOMAIN);?></h2> <?php else:?> <h2 class="center"><?php _e('Nothing Found',TDOMAIN);?></h2> <?php endif;?> <p class="center"><?php _e('Sorry, what you are looking for isn't here.', TDOMAIN);?></p> <div class="center fix"><?php get_search_form(); ?></div> </div> </div> </div> <?php endif; ?>

Share this post


Link to post
Share on other sites
cmunns

It indeed does not contain a is_search...what Andrew meant is that you have to add one to accomplish what you want. Change this line : `<?php if(pl_show_content($post->ID)):?>` to this: `<?php if(pl_show_content($post->ID) || is_search()):?>`

Share this post


Link to post
Share on other sites
jdownnza

Hi, I am using iblog 3.0.6 on a site and want to display full posts on search results. In _posts.php the closest I have to: <?php if(pl_show_content($post->ID)):?> is this: <?php if(pl_show_content($post->ID) || is_category()):?> And when I replace it as you suggest, it messes up the site. How do I display full posts on search results pages? Thanks!

Share this post


Link to post
Share on other sites
jdownnza

I also have a site with iBlogPro 4.2.0 and I need to know how to make the search results pages show full posts. I did what was suggested above, and it makes the category pages show full content, but on the search results pages, it shows excerpts. Thanks!

Share this post


Link to post
Share on other sites
jdownnza

Any help? I want to show full posts on all pages. I also want to have the category title tags NOT be auto-capitalized. Here is my _posts.php file: ` <?php if ( is_category() ) { ?>

<?php single_cat_title(); ?>

<?php } ?> <?php if (!is_404() && have_posts()) : while (have_posts()) : the_post(); ?> <?php if(is_single()):?>
<?php previous_post_link('%link') ?> <?php next_post_link('%link') ?>
<?php endif;?>
<?php if(!is_page()):?>
<?php if(pl_show_thumb($post->ID)): ?> <?php elseif (get_post_meta($post->ID, 'thumb', true)): ?> <?php $postimageurl = get_post_meta($post->ID, 'thumb', true); ?> <?php endif; ?>

<?php the_title(); ?>

<?php _e('',TDOMAIN);?> <?php the_time(get_option('date_format')); ?> - <?php _e('Posted in',TDOMAIN);?> <?php the_category(' ') ?> <?php _e('',TDOMAIN);?> <?php the_author(); ?> <?php edit_post_link(__('(Edit Post)', TDOMAIN), ' ', ' ');?>
<?php if(pl_show_excerpt($post->ID)):?>
<?php the_excerpt(); ?>
<?php endif; ?>
<?php endif;?> <?php if(pl_show_content($post->ID)):?>
<?php if(pagelines('pagetitles') && is_page() || is_page_template('page-feature-blog.php')):?>

<?php the_title(); ?>

<?php endif;?>
<?php the_content(__('

Continue reading ?»

',TDOMAIN)); ?> <?php wp_link_pages(__('

Pages:', TDOMAIN), '

', __('number', TDOMAIN)); ?> <?php edit_post_link(__('Edit',TDOMAIN), '

', '

'); ?>
<?php if(pagelines('authorinfo') && is_single()):?> <?php include(THEME_LIB.'/_authorinfo.php');?> <?php endif;?> <?php endif;?> <?php if(!is_page()) include(THEME_LIB.'/_post_footer.php');?>
<?php if(!is_page()):?>
<?php the_tags(__('Tagged with: ', TDOMAIN),' ??? ',''); ?>? 
<?php endif;?>
<?php if(is_single() || is_page()):?> <?php if(VPRO) include(THEME_LIB."/_contentsidebar.php");?>
<?php comments_template();?>
<?php endif; endwhile; ?> <?php include(THEME_LIB.'/_pagination.php');?> <?php else : ?>
<?php if(is_404()):?>

<?php _e('Error 404 - Page Not Found',TDOMAIN);?>

<?php else:?>

<?php _e('Nothing Found',TDOMAIN);?>

<?php endif;?>

<?php _e('Sorry, what you are looking for isn't here.', TDOMAIN);?>

<?php get_search_form(); ?>
<?php endif; ?> `

Share this post


Link to post
Share on other sites
jdownnza

Here is the code if the above doesn't display properly for you: <?php if ( is_category() ) { ?> <p><h1><?php single_cat_title(); ?></h1></p> <?php } ?> <?php if (!is_404() && have_posts()) : while (have_posts()) : the_post(); ?> <?php if(is_single()):?> <div class="post-nav"> <span class="previous"><?php previous_post_link('%link') ?></span> <span class="next"><?php next_post_link('%link') ?></span></div> <?php endif;?> <div class="postwrap fix"> <div <?php post_class() ?> id="post-<?php the_ID(); ?>"> <?php if(!is_page()):?> <div class="copy fix"> <?php if(pl_show_thumb($post->ID)): ?> <div class="thumb left"> " rel="bookmark" title="<?php _e('Permanent Link To', TDOMAIN);?> <?php the_title_attribute();?>"> <?php the_post_thumbnail('thumbnail');?> </div> <?php elseif (get_post_meta($post->ID, 'thumb', true)): ?> <?php $postimageurl = get_post_meta($post->ID, 'thumb', true); ?> <div class="thumb left"> " rel="bookmark" title="<?php _e('Permanent Link To', TDOMAIN);?> <?php the_title_attribute();?>"> " alt="Post Pic" width="200" height="200" /> </div> <?php endif; ?> <div class="post-header fix <?php if(!pl_show_thumb($post->ID) && !get_post_meta($post->ID, 'thumb', true)) echo 'post-nothumb';?>"> <div class="post-title-section fix"> <div class="post-title fix"> <h2>" rel="bookmark" title="<?php _e('Permanent Link to',TDOMAIN);?> <?php the_title_attribute(); ?>"><?php the_title(); ?></h2> <div class="metabar"> <?php _e('',TDOMAIN);?> <?php the_time(get_option('date_format')); ?> - <?php _e('Posted in',TDOMAIN);?> <?php the_category(' ') ?> <?php _e('',TDOMAIN);?> <?php the_author(); ?> <?php edit_post_link(__('(Edit Post)', TDOMAIN), ' ', ' ');?> </div> </div> </div> <!--/post-title --> <?php if(pl_show_excerpt($post->ID)):?> <div class="post-excerpt"> <?php the_excerpt(); ?> </div> <?php endif; ?> </div> </div> <?php endif;?> <?php if(pl_show_content($post->ID)):?> <div class="copy fix"> <?php if(pagelines('pagetitles') && is_page() || is_page_template('page-feature-blog.php')):?> <h1 class="pagetitle"><?php the_title(); ?></h1> <?php endif;?> <div class="textcontent"> <?php the_content(__('<p>Continue reading »</p>',TDOMAIN)); ?> <?php wp_link_pages(__('<p>Pages:', TDOMAIN), '</p>', __('number', TDOMAIN)); ?> <?php edit_post_link(__('Edit',TDOMAIN), '<p>', '</p>'); ?> <div class="clear"></div> </div> </div> <?php if(pagelines('authorinfo') && is_single()):?> <?php include(THEME_LIB.'/_authorinfo.php');?> <?php endif;?> <?php endif;?> <?php if(!is_page()) include(THEME_LIB.'/_post_footer.php');?> </div><!--post --> </div> <?php if(!is_page()):?> <div class="tags"> <?php the_tags(__('Tagged with: ', TDOMAIN),' • ',''); ?> </div> <?php endif;?> <div class="clear"></div> <?php if(is_single() || is_page()):?> <?php if(VPRO) include(THEME_LIB."/_contentsidebar.php");?> <div class="postwrap commentswrap <?php if(!have_comments() && 'open' != $post->comment_status) echo "nocommentform";?>"> <div class="hentry"> <div class="copy"> <?php comments_template();?></div> </div> </div> <?php endif; endwhile; ?> <?php include(THEME_LIB.'/_pagination.php');?> <?php else : ?> <div class="postwrap fix"> <div class="hentry"> <div class="billboard"> <?php if(is_404()):?> <h2 class="center"><?php _e('Error 404 - Page Not Found',TDOMAIN);?></h2> <?php else:?> <h2 class="center"><?php _e('Nothing Found',TDOMAIN);?></h2> <?php endif;?> <p class="center"><?php _e('Sorry, what you are looking for isn't here.', TDOMAIN);?></p> <div class="center fix"><?php get_search_form(); ?></div> </div> </div> </div> <?php endif; ?>

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

×