WordPress.org

Ready to get started?Download WordPress

Forums

single.php overun by 404 (9 posts)

  1. gatessg
    Member
    Posted 1 year ago #

    When clicking on the title of a post instead of loading the single.php page it appears my 404.php is loaded instead.

    Any idea why this is happening? This is my loop on my index page.

    <div id="container"> <!-- THIS IS WHERE THE LOOP STARTS -->
    			<?php if(have_posts()) : ?><?php while(have_posts()) : the_post(); ?>
    
    				<div class="post" id="post-<?php the_ID(); ?>">
    					<h2><a href=”<?php the_permalink(); ?>”><?php the_title(); ?></a></h2>
    
    					<?php the_post_thumbnail(); ?>
    
    					<div class="content">
    						<?php the_content(); ?>
    
    						<p class="postmetadata">
    	<?php _e('Filed under:'); ?> <?php the_category(', ') ?> <?php _e('by'); ?> <?php  the_author(); ?><br />
    	<?php comments_popup_link('No Comments »', '1 Comment »', '% Comments »'); ?> <?php edit_post_link('Edit', ' | ', ''); ?>
    						</p>
    
    					</div> <!-- content -->
    
    				</div> <!-- post -->
    
    			<?php endwhile; ?>
    
    				<div class="navigation">
    					<?php posts_nav_link('','back','next'); ?>
    				</div>
    
    			<?php else: ?>
    				<div class="post">
    					<h2><?php _e('Not Found'); ?></h2>
    				</div>
    
    			<?php endif; ?>
    		</div> <!-- containter******* THIS IS WHERE THE LOOP ENDS-->

    I have looked all over and cant seem to find an answer. my permalink settings are set on default and i have tried all options.

  2. pete_398
    Member
    Posted 1 year ago #

    What do your web server (access) logs state ? Are there any entries in the php error log file ?

  3. gatessg
    Member
    Posted 1 year ago #

    Its all running locally?

  4. pete_398
    Member
    Posted 1 year ago #

    Then you will have a php error log file, usually called error_log, unless you display errors to the browser. Being local, you know what is in .htaccess, and what causes the 404 , not found.

  5. gatessg
    Member
    Posted 1 year ago #

    How do I go about finding this?

  6. pete_398
    Member
    Posted 1 year ago #

    Look for a file called error_log

  7. gatessg
    Member
    Posted 1 year ago #

    I'm coding this from scratch. only have a index, single, functions, and style page.

  8. gatessg
    Member
    Posted 1 year ago #

    In the above code doesn't it seem that everything is typed out correctly for the index loop?

  9. pete_398
    Member
    Posted 1 year ago #

    It's somewhat irrelevant whether your code 'works' or not. If you are getting a 404 (not found) when you click on a link, please advise the link contents, in full.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.