StudioPress Community Forums

StudioPress Community Forums (http://www.studiopress.com/support/index.php)
-   General Discussion (http://www.studiopress.com/support/forumdisplay.php?f=7)
-   -   author.php duplicate info (http://www.studiopress.com/support/showthread.php?t=24309)

fmf 03-18-2010 11:47 AM

author.php duplicate info
 
I am using the author.php page from the agent theme to create individual author pages within the news theme. I had no trouble implementing this and the page worked exactly as expected until last monday when suddenly the author information began to duplicate. I had not changed the code. I have tried:

- changing showposts to 0 / 1 / 2 (i get 6x / 2x / 3x info respectively)
- posting the agent author.php file as-is (still get 2x info)

Any help would be appreciated!! BTW i am running WPMU

Example URL: http://msmagazine.com/blog/blog/author/admin/

thanks in advance,
Courtney

p.s. i posted this over at the agent board a week ago but didnt get a response - thought it might be better over here :???:

adew 03-18-2010 07:38 PM

Hi,

Can you post the page template you're using?

fmf 03-19-2010 04:38 PM

Here is the code of the modified page. The duplication also happened when i used the agent author.php file without modifications. Thank you for looking.

Code:

<?php get_header(); ?>

<div id="content">

        <div id="contentleft">
       
                <div class="post">
       
                <?php include(TEMPLATEPATH."/breadcrumb.php");?>
                       
                        <div class="postarea">
                <?php $recent = new WP_Query('showposts=1'); while($recent->have_posts()) : $recent->the_post();?>
               
                        <h3><?php _e('Ms. Blogger', 'studiopress'); ?></h3>
               
                                <?php if(isset($_GET['author_name'])) :
                                        $curauth = get_userdatabylogin($author_name);
                                        else :
                                        $curauth = get_userdata(intval($author));
                                        endif;
                                ?>
                 
                <div class="authorbio">
                    <p><?php if(file_exists(TEMPLATEPATH.'/images/team/'.$curauth->ID.'.jpg')) : ?>
                    <img class="thumb" src="<?php bloginfo('template_url'); ?>/images/team/<?php echo $curauth->ID; ?>.jpg" alt="<?php echo $curauth->display_name; ?>" title="<?php echo $curauth->display_name; ?>" />
                    <?php endif; ?>
                    <b><?php echo $curauth->display_name; ?></b><br />
                    <?php echo $curauth->description; ?></p>
                    <p></p>
                    <p><strong><?php _e('Website: ', 'studiopress'); ?></strong><a href="<?php echo $curauth->user_url; ?>" target="_blank"><?php echo $curauth->user_url; ?></a> <br />
                    <strong><?php _e('Twitter: ', 'studiopress'); ?></strong><a href="<?php _e('http://twitter.com/', 'studiopress'); ?><?php echo $curauth->twitter; ?>" target="_blank"><?php echo $curauth->twitter; ?></a></p>
                </div>
               
                <div class="clear"></div>
               
                <?php endwhile; ?>
            <div class="authorposts">
                        <h3><?php echo $curauth->display_name; ?><?php _e('\'s Posts', 'studiopress'); ?></h3>
           
                        <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
                        <?php if( get_post_meta($post->ID, "thumb", true) ): ?>
                        <?php $theImageSrc = get_image_path(); ?>
                        <a href="<?php the_permalink() ?>" rel="bookmark"><img class="thumb" src="<?php bloginfo('template_directory'); ?>/tools/timthumb.php?src=<?php echo $theImageSrc; ?>&amp;h=<?php echo get_theme_mod('archive_thumb_height'); ?>&amp;w=<?php echo get_theme_mod('archive_thumb_width'); ?>&amp;zc=1" alt="<?php the_title(); ?>" /></a>       
                        <?php else: ?>
                        <?php endif; ?>       
                           
                        <h4><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h4>
                       
                        <div class="date">
                                <p><span class="time"><?php the_time('F j, Y'); ?></span> <?php _e("by", 'studiopress'); ?> <?php the_author_posts_link(); ?> &middot; <span class="icomment"><a rel="nofollow" href="<?php the_permalink(); ?>#respond"><?php comments_number(__('Leave a Comment', 'studiopress'), __('1 Comment', 'studiopress'), __('% Comments', 'studiopress')); ?></a></span>&nbsp;<?php edit_post_link(__('(Edit)', 'studiopress'), '', ''); ?></p>
                        </div>
               
                        <?php the_excerpt();?>
           
            <div class="clear"></div>
                       
                        <div class="postmeta2">
                <p><?php _e("Filed under", 'studiopress'); ?> <?php the_category(', ') ?> &middot; <span class="tags"><?php _e("Tagged with", 'studiopress'); ?> <?php the_tags('') ?></span></p>
            </div>
                       
               
                                <?php endwhile; ?>
               
                      <?php endif; ?>
                       
            <p><?php posts_nav_link(' — ', __('&laquo; Previous Page', 'studiopress'), __('Next Page &raquo;', 'studiopress')); ?></p>
                                   
                </div>
                       
                </div>
                </div>               
        </div>
       
<?php get_sidebar(); ?>
               
</div>

<?php get_footer(); ?>


adew 03-20-2010 03:26 AM

I tried using your file on a test site, and couldn't recreate the duplication.

Let's try a couple of things. First,comment out this:
PHP Code:

<?php $recent = new WP_Query('showposts=1'); while($recent->have_posts()) : $recent->the_post();?>

ie like this:
PHP Code:

<?php // $recent = new WP_Query('showposts=1'); while($recent->have_posts()) : $recent->the_post();?>

and do the same with this:
PHP Code:

<?php endwhile; ?>

ie this:
PHP Code:

<?php // endwhile; ?>

just above the authorposts div.

fmf 03-22-2010 12:27 PM

Ok -- I am uploading now .... OMG it worked!

Thank you Thank you! Any idea why this happened? I am still mystified as it randomly presented itself (the duplicates) one day without any code changes.

Thank you again!


All times are GMT -5. The time now is 08:10 AM.

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.