Wordpress Redirect Loop for Author Link

Discussion in 'WordPress' started by Stu--, May 27, 2009.

  1. #1
    Stu--, May 27, 2009 IP
  2. djuicePK

    djuicePK Peon

    Messages:
    77
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    nobody can guess anything untill you show the code of

    author.php (if exists) otherwise
    archive.php
     
    djuicePK, May 28, 2009 IP
  3. Stu--

    Stu-- Active Member

    Messages:
    355
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    53
    #3
    Ah, sorry.

    Archive.php
    <?php get_header(); ?>
    <div id="container" class="clearfix">
      <div id="leftnav">
        <?php get_sidebar(); ?>
      </div>
      <div id="rightnav">
        <?php include (TEMPLATEPATH . '/sidebar2.php'); ?>
      </div>
    
    <div id="content">
    
    		 <?php $post = $posts[0]; // Hack. Set $post so that the_date() works. ?>
    
    <?php /* If this is a category archive */ if (is_category()) { ?>				
    		<h1 class="pagetitle"><?php echo single_cat_title(); ?></h1>
    <?php /* If this is a daily archive */ } elseif (is_day()) { ?>
    		<h1 class="pagetitle">Archive for <?php the_time('F jS, Y'); ?></h1>
    <?php /* If this is a yearly archive */ } elseif (is_year()) { ?>
    		<h1 class="pagetitle">Archive for <?php the_time('Y'); ?></h1>
    <?php /* If this is a search */ } elseif (is_search()) { ?>
    		<h1 class="pagetitle">Search Results</h1>
    <?php /* If this is an author archive */ } elseif (is_author()) { ?>
    		<h1 class="pagetitle">Author Archive</h1>
    <?php /* If this is a paged archive */ } elseif (isset($_GET['paged']) && !empty($_GET['paged'])) { ?>		
                    <h1 class="pagetitle">Archives</h1>
     <?php } ?>
    
    	   <?php if (have_posts()) : ?>
    		<?php while (have_posts()) : the_post(); ?>
              		<div class="post" id="post-<?php the_ID(); ?>">
    
    	        	<h2><a title="Permanent Link to <?php the_title(); ?>" href="<?php the_permalink() ?>" rel="bookmark"><strong><?php the_title(); ?></strong></a></h2>
    
                            <div class="postmetadata"><strong>Written By:</strong> <?php the_author_posts_link(); ?> | <?php the_time('M') ?> <?php the_time('d') ?> <?php the_time('Y') ?> | <strong>Posted in:</strong> <?php the_category(', ') ?> | <?php comments_popup_link('No Comments', '1 Comment', '% Comments'); ?>  <?php edit_post_link(' | Edit',' ',''); ?></div>
    
                            <div><?php the_excerpt(); ?></div>
                             </div>
    
    	        <?php endwhile; ?>
    	<div class="navigation">
    		<div class="alignleft"><?php next_posts_link('&laquo; Previous Entries') ?></div>
    		<div class="alignright"><?php previous_posts_link('Next Entries &raquo;') ?></div>
    	</div> <!-- end navigation -->
    	   <?php else : ?>
            	<h2>Not Found</h2>
    		<p>Sorry, but you are looking for something that isn't here.</p>
    	    <?php endif; ?>		
    
    	
    		<br/><br/><strong>Can't find what you're looking for? Try a Search</strong<br/><?php include (TEMPLATEPATH . '/searchform.php'); ?>
    </div>    
        <?php get_footer(); ?>
    </div>
    </body>
    </html>
    Code (markup):
    and Archives.php
    <?php
    /*
    Template Name: Archives
    */
    ?>
    
    <?php get_header(); ?>
      <div id="container" class="clearfix">
       <div id="leftnav">
    	  <?php get_sidebar(); ?>
        </div>
        <div id="rightnav">
    	  <?php include (TEMPLATEPATH . '/sidebar2.php'); ?>
    </div>
    <div id="content">
    
    <?php include (TEMPLATEPATH . '/searchform.php'); ?>
    
    <h2>Archives by Month:</h2>
      <ul>
        <?php wp_get_archives('type=monthly'); ?>
      </ul>
    
    <h2>Archives by Subject:</h2>
      <ul>
         <?php wp_list_cats(); ?>
      </ul>
    </div>
    
    <?php get_footer(); ?>
    </div>	
    Code (markup):
    Thanks for your help.
     
    Stu--, May 28, 2009 IP
  4. Stu--

    Stu-- Active Member

    Messages:
    355
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    53
    #4
    Can anyone help with this problem?

    It's probably just a bug in my code.
     
    Stu--, Jun 1, 2009 IP
  5. BANAGO

    BANAGO Active Member

    Messages:
    456
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    58
    #5
    I cannot access the link you have provided. the code seems OK.
     
    BANAGO, Jun 1, 2009 IP
  6. Stu--

    Stu-- Active Member

    Messages:
    355
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    53
    #6
    You can't access it because it goes into a redirect loop, that's the issue.

    I heard that this is a common WP problem, but nobody seems to know much about it.
     
    Stu--, Jun 1, 2009 IP