• I am jumping into a site that was developed by another person. The site has loops that are working as feeds throughout the site, however, if you click on a post to view the full article/etc, it takes you to a blank page. It seems as though the single.php is not working properly.

    single.php does exist on the server, I tried replacing it with a default single.php to no avail. Permalink reset does nothing. If I try previewing the post in the wordpress admin I also get a blank page.

    New to WP, appreciate any help.

Viewing 1 replies (of 1 total)
  • Thread Starter mrutt

    (@mrutt)

    Posts are previewing properly to the feed at this code

    <?php query_posts('posts_per_page=2&cat=3'); ?>
    
     <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
    
    	<br />
        <a href="<?php the_permalink() ?>" class="news-title"><?php the_title(); ?></a>
    
        <p><?php /* the_excerpt(); */
    
    		$trimexcerpt = get_the_excerpt();
    		$shortexcerpt = wp_trim_words(
      		$trimexcerpt,
    
    		// limit number of words
      		$num_words = 25,
    
    		// design your read more link
      		$more = '… <a href="' . get_permalink() . '">more</a>' );
    
    		// show excerpt with read more link
    		echo '<p>' . $shortexcerpt . '</p>';
    
    	?></p>
    
        <br />
    
    	<?php endwhile; else: ?>
    
    	<p>Sorry, no posts matched your criteria.</p>
    
    <?php endif; ?>

    this is the current single.php

    <?php
    /**
     * The Template for displaying all single posts.
     */
    
    get_header(); ?>
    
    <div id="content" role="main">
    
        <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
        <div <?php post_class() ?> id="post-<?php the_ID(); ?>">
            <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
            <small><?php the_time('F jS, Y') ?> <!-- by <?php the_author() ?> --></small>
    
            <div class="entry">
                <?php the_content(); ?>
            </div>
    
            <p class="postmetadata"><?php the_tags('Tags: ', ', ', '<br />'); ?> Posted in <?php the_category(', ') ?> | <?php edit_post_link('Edit', '', ' | '); ?>  <?php comments_popup_link('No Comments ?', '1 Comment ?', '% Comments ?'); ?></p>
        </div>
        <?php endwhile; endif; ?>
    
    </div><!-- #content -->
    
    <br /><hr /><br />    
    
    <div class="navigation">
        <div class="left50">
        <?php previous_post('? %',
         'Previous Post ', 'in_same_cat', 'yes' ); ?>
        </div><!--/left50-->
    
        <div class="right50">
        <?php next_post('% ? ',
         'Next Post', 'in_same_cat', 'yes' ); ?>
        </div><!--/right50-->
    </div> <!--/navigation-->
    
    <div style="clear:both;"></div>
    <?php get_footer(); ?>

    [Moderator Note: No bumping. If it’s that urgent, consider hiring someone instead.]

Viewing 1 replies (of 1 total)
  • The topic ‘Empty Single.php’ is closed to new replies.