Title: How to edit post PHP
Last modified: August 19, 2016

---

# How to edit post PHP

 *  [beardymouse](https://wordpress.org/support/users/beardymouse/)
 * (@beardymouse)
 * [16 years, 1 month ago](https://wordpress.org/support/topic/how-to-edit-post-php/)
 * I’m editing a theme and am happy with how the homepage looks. However, once I
   go into a post, I want to change how that looks on the page.
 * How do I edit how the post is displayed once you click on it? Is there a particular
   php file for it?
 * I’m editing the Modicus 0.2 theme

Viewing 4 replies - 1 through 4 (of 4 total)

 *  [Samuel B](https://wordpress.org/support/users/samboll/)
 * (@samboll)
 * [16 years, 1 month ago](https://wordpress.org/support/topic/how-to-edit-post-php/#post-1387422)
 * theme’s `single.php` is used to display the single post
 *  Thread Starter [beardymouse](https://wordpress.org/support/users/beardymouse/)
 * (@beardymouse)
 * [16 years, 1 month ago](https://wordpress.org/support/topic/how-to-edit-post-php/#post-1387428)
 * Thank you!
 *  Thread Starter [beardymouse](https://wordpress.org/support/users/beardymouse/)
 * (@beardymouse)
 * [16 years, 1 month ago](https://wordpress.org/support/topic/how-to-edit-post-php/#post-1387431)
 * Next question: my theme on the homepage has two sidebars. On the post page, I
   want sidebar 1 to disappear and the post to fill that space. Any idea what I’d
   need to remove from the code for that.
 * Code on the single.php page is:
 *     ```
       <?php get_header(); ?>
   
       	<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
       <div class="post" id="post-<?php the_ID(); ?>">
       	<div class="entry">
       				<?php the_content('<p class="serif">Read the rest of this entry &raquo;</p>'); ?>
   
       				<?php wp_link_pages(array('before' => '<p><strong>Pages:</strong> ', 'after' => '</p>', 'next_or_number' => 'number')); ?>
       <br />
       	<ul>
       		<li><b>BROWSE</b> / IN TIMELINE</li>
       			<li><?php previous_post_link('&laquo; %link'); ?></li>
       			<li><?php next_post_link('&raquo; %link'); ?></li>
       		</ul>
       				<ul>
       				<li><b>BROWSE</b> / IN <span class="cat"><?php
       foreach((get_the_category()) as $cat) {
       echo $cat->cat_name . ' ';
       } ?>
       			</span>
       		</li>
   
       			<li><?php previous_post_link('&laquo; %link', '%title', TRUE); ?></li>
       			<li><?php next_post_link('&raquo; %link', '%title', TRUE); ?></li>
       		</ul>
   
       		<?php if ( function_exists('related_posts')) :?>
       		<ul>
       			<li><b>RELATED</b> / YOU MIGHT FIND THESE INTERESTING</li>
       			<?php related_posts(); ?>
       		</ul>
       		<?php endif; ?>
       			</div><!-- end entry -->
   
       				<?php comments_template(); ?>
       	<a href="#top" title="Return to Top"><img src="<?php bloginfo(template_directory); ?>/images/top.png" alt="Return to Top" width="20"/></a>
   
       </div><!-- end post -->
       <div id="sidebar2">
       	<h1><a href="<?php echo get_permalink() ?>" rel="bookmark" title="Permanent Link: <?php the_title(); ?>"><?php the_title(); ?></a></h1>
       	<p class="postmetadata alt">
       		<small>
       			Posted on <?php the_time('m.d.y') ?>
       			to <?php the_category(', ') ?>. <?php if (function_exists('the_tags') ) : ?><?php the_tags('Tags: ', ', ', '. '); ?>
       <?php endif; ?>
   
       						<?php comments_rss_link('Subscribe'); ?> to follow comments on this post.
   
       						<?php if (('open' == $post-> comment_status) && ('open' == $post->ping_status)) {
       							// Both Comments and Pings are open ?>
       							<?php comments_number('No comments yet.','One comment.','% comments.'); ?> <a href="#respond">Add your thoughts</a> or <a href="<?php trackback_url(true); ?>" rel="trackback">trackback</a> from your own site.
   
       						<?php } elseif (!('open' == $post-> comment_status) && ('open' == $post->ping_status)) {
       							// Only Pings are Open ?>
       			Responses are currently closed, but you can <a href="<?php trackback_url(true); ?> " rel="trackback">trackback</a> from your own site.
   
       						<?php } elseif (('open' == $post-> comment_status) && !('open' == $post->ping_status)) {
       							// Comments are open, Pings are not ?>
       			You can skip to the end and leave a response. Pinging is currently not allowed.
   
       						<?php } elseif (!('open' == $post-> comment_status) && !('open' == $post->ping_status)) {
       							// Neither Comments, nor Pings are open ?>
       			Both comments and pings are currently closed.
   
       						<?php } edit_post_link('Edit this entry.','',''); ?>
       		</small>
       	</p>
   
       	<?php endwhile; else: ?>
       	<p>Sorry, no posts matched your criteria.</p>
   
       <?php endif; ?><?php get_sidebar(); ?>
   
       <?php get_footer(); ?>
       ```
   
 *  Thread Starter [beardymouse](https://wordpress.org/support/users/beardymouse/)
 * (@beardymouse)
 * [16 years, 1 month ago](https://wordpress.org/support/topic/how-to-edit-post-php/#post-1387757)
 * Anyone? Really stumped on this one

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘How to edit post PHP’ is closed to new replies.

## Tags

 * [modicus](https://wordpress.org/support/topic-tag/modicus/)
 * [php](https://wordpress.org/support/topic-tag/php/)
 * [posts](https://wordpress.org/support/topic-tag/posts/)

 * 4 replies
 * 2 participants
 * Last reply from: [beardymouse](https://wordpress.org/support/users/beardymouse/)
 * Last activity: [16 years, 1 month ago](https://wordpress.org/support/topic/how-to-edit-post-php/#post-1387757)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
