Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   Post-Kicker, -Byline & -Footer (http://forum.bytesforall.com/forumdisplay.php?f=17)
-   -   [SOLVED] How to control display of search results? Part 2 (http://forum.bytesforall.com/showthread.php?t=11699)

lovin'wordpress Dec 13, 2010 01:04 AM

[SOLVED] How to control display of search results? Part 2
 
Hello,

I have the exact same question and would like the same result as to not have the "post-byline" and "post-footer" show up in search results. Based on the thread:

http://forum.bytesforall.com/showthread.php?t=610

I tried following the steps but maybe in Atahualpa 3.5.3, the coding might have changed, I don't know, because I can't find what Flynn was talking about. What I see for the index.php file is this:

Code:

<?php        /* get all options: */
# error_reporting(-1);
include (TEMPLATEPATH . '/functions/bfa_get_options.php');
global $bfa_ata;
get_header(); ?>

<?php /* If there are any posts: */
if (have_posts()) : $bfa_ata['postcount'] = 0; /* Postcount needed for option "XX first posts full posts, rest excerpts" */ ?>

        <?php /* This outputs the next/previous post or page navigation.
        This can be edited at Atahualpa Theme Options -> Style & edit the Center column */
        bfa_center_content($bfa_ata['content_above_loop']); ?>

        <?php /* The LOOP starts here. Do this for all posts: */
        while (have_posts()) : the_post(); $bfa_ata['postcount']++; ?>
       
                <?php /* Add Odd or Even post class so post containers can get alternating CSS style (optional) */
                $odd_or_even = (($bfa_ata['postcount'] % 2) ? 'odd-post' : 'even-post' ); ?>

                <?php /* This is the actual Wordpress LOOP.
                The output can be edited at Atahualpa Theme Options -> Style & edit the Center column */
                bfa_center_content($bfa_ata['content_inside_loop']); ?>
                                               
        <?php /* END of the LOOP */
        endwhile; ?>

        <?php /* This outputs the next/previous post or page navigation and the comment template.
        This can be edited at Atahualpa Theme Options -> Style & edit the Center column */
        bfa_center_content($bfa_ata['content_below_loop']); ?>

<?php /* END of: If there are any posts */
else : /* If there are no posts: */ ?>

<?php /* This outputs the "Not Found" content, if neither posts, pages nor attachments are available for the requested page.
This can be edited at Atahualpa Theme Options -> Style & edit the Center column */
bfa_center_content($bfa_ata['content_not_found']); ?>

<?php endif; /* END of: If there are no posts */ ?>

<?php bfa_center_content($bfa_ata['center_content_bottom']); ?>

<?php get_footer(); ?>


How do I apply what he has mentioned earlier in thread:
http://forum.bytesforall.com/showthread.php?t=610

and modify the code so that search results will have no "post-byline" and "post-footer"

the closest I got was this but I only can get 1 search result and not all search results:

Code:

<?php        /* get all options: */
# error_reporting(-1);
include (TEMPLATEPATH . '/functions/bfa_get_options.php');
global $bfa_ata;
get_header(); ?>

<?php /* If there are any posts: */
if (have_posts()) : $bfa_ata['postcount'] = 0; /* Postcount needed for option "XX first posts full posts, rest excerpts" */ ?>

        <?php /* This outputs the next/previous post or page navigation.
        This can be edited at Atahualpa Theme Options -> Style & edit the Center column */
        bfa_center_content($bfa_ata['content_above_loop']); ?>

        <?php /* Post Container starts here */
if ( function_exists('post_class') ) { ?>
<div <?php if ( is_page() ) { post_class('post'); } else { post_class("$odd_or_even"); } ?> id="post-<?php the_ID(); ?>">
<?php } else { ?>
<div class="<?php echo ( is_page() ? 'page ' : '' ) . $odd_or_even . ' post" id="post-'; the_ID(); ?>">
<?php } ?>

<?php bfa_post_kicker('<div class="post-kicker">','</div>'); ?>

<?php bfa_post_headline('<div class="post-headline">','</div>'); ?>

<?php bfa_post_bodycopy('<div class="post-bodycopy clearfix">','</div>'); ?>

<?php bfa_post_pagination('<p class="post-pagination"><strong>'.__('Pages:','atahualpa').'</strong>','</p>'); ?>

</div><!-- / Post -->

<?php /* This outputs the "Not Found" content, if neither posts, pages nor attachments are available for the requested page.
This can be edited at Atahualpa Theme Options -> Style & edit the Center column */
?>

<?php endif; /* END of: If there are no posts */ ?>

<?php bfa_center_content($bfa_ata['center_content_bottom']); ?>

<?php get_footer(); ?>


Any input would be great, thank you

juggledad Dec 13, 2010 04:14 AM

Yes things have changed and now it is easier. You can go to ato->Style & editCENTER COLUMN->The LOOP and put an 'if (!is_search() ) {..........}' around the sections you don't want to show up. The '!' is an NOT.

lovin'wordpress Dec 13, 2010 07:24 AM

Hi again, ok I'm real slow at this... but please show where would you input it since I want the "post-byline" and the "post-footer" to disappear only when a search is being done. Here's what I have in my LOOP:

Code:

<?php /* For SINGLE post pages if activated at ATO -> Next/Previous Navigation: */
bfa_next_previous_post_links('Top'); ?>

<?php /* Post Container starts here */
if ( function_exists('post_class') ) { ?>

<div <?php if ( is_page() ) { post_class('post'); } else { post_class("$odd_or_even"); } ?> id="post-<?php the_ID(); ?>">
<?php } else { ?>
<div class="<?php echo ( is_page() ? 'page ' : '' ) . $odd_or_even . ' post" id="post-'; the_ID(); ?>">
<?php } ?>

<?php bfa_post_kicker('<div class="post-kicker">','</div>'); ?>

<?php bfa_post_headline('<div class="post-headline">','</div>'); ?>

if ( !is_search() ) {<?php bfa_post_byline('<div class="post-byline">','</div>'); ?>}

<?php bfa_post_bodycopy('<div class="post-bodycopy clearfix">','</div>'); ?>

<?php bfa_post_pagination('<p class="post-pagination"><strong>'.__('Pages:','atahualpa').'</strong>','</p>'); ?>

<?php bfa_post_footer('<div class="post-footer">','</div>'); ?>

</div><!-- / Post -->


Much appreciated:)

lovin'wordpress Dec 13, 2010 07:48 AM

hi again juggledad,

You seem to be always helping me, I'll be offering a donation for your time. By the way, I figured it out anyway and am posting the code here in case anybody else is interested to know:

This is how to get rid of the "post-byline" and the "post-footer" details if you don't want it to show up on your search results page with Atahualpa 3.5.3. Thanks to juggledad for supplying the solution:

Code:

<?php /* For SINGLE post pages if activated at ATO -> Next/Previous Navigation: */
bfa_next_previous_post_links('Top'); ?>

<?php /* Post Container starts here */
if ( function_exists('post_class') ) { ?>

<div <?php if ( is_page() ) { post_class('post'); } else { post_class("$odd_or_even"); } ?> id="post-<?php the_ID(); ?>">
<?php } else { ?>
<div class="<?php echo ( is_page() ? 'page ' : '' ) . $odd_or_even . ' post" id="post-'; the_ID(); ?>">
<?php } ?>

<?php bfa_post_kicker('<div class="post-kicker">','</div>'); ?>

<?php bfa_post_headline('<div class="post-headline">','</div>'); ?>

<?php
if (!is_search() ) {
bfa_post_byline('<div class="post-byline">','</div>');
}
?>

<?php bfa_post_bodycopy('<div class="post-bodycopy clearfix">','</div>'); ?>

<?php bfa_post_pagination('<p class="post-pagination"><strong>'.__('Pages:','atahualpa').'</strong>','</p>'); ?>

<?php
if (!is_search() ) {
bfa_post_footer('<div class="post-footer">','</div>');
}
?>

</div><!-- / Post -->



All times are GMT -6. The time now is 01:49 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.