Title: Fixing Main Index Code
Last modified: August 19, 2016

---

# Fixing Main Index Code

 *  Resolved [chefsherry](https://wordpress.org/support/users/chefsherry/)
 * (@chefsherry)
 * [16 years, 3 months ago](https://wordpress.org/support/topic/fixin-main-index-code/)
 * I am very new to WordPress and have very little coding experience. I thought 
   this was going to be easier to use than it is.
 * I was trying to remove the “read more” links from the Main Index Template, but
   have totally messed up my site layout. My WordPress site is not live yet, but
   I am using this template:
 * [http://newwpthemes.com/demo/iRecipes/](http://newwpthemes.com/demo/iRecipes/)
 * This is the code I deleted from the Main Index Page:
 * class=”readmorecontent”>
    <a class=”readmore”
 * Here is where I deleted from (right after the_content section):
 * the_content(”); ?>
    <a <div href=”<?php the_permalink() ?>” rel=”bookmark” title
   =”Permanent Link to <?php the_title_attribute(); ?>”>Read More » </div> </div
   >
 *  </div><!–/post-<?php the_ID(); ?>–>
    </div>
 *  <?php endwhile; ?>
 * How can I get the page to align properly?
 * Is there any way to remove the read more and the … from my posts?
 * Thanks so very much!
    Sherry

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

 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [16 years, 3 months ago](https://wordpress.org/support/topic/fixin-main-index-code/#post-1369975)
 * if this is your first major modification, i would suggest to reupload the original
   file, to get the site back working.
 * btw: when you post code here in the forum, please use the ‘code’ button’ on top
   of this little editor window – press once before you paste the code, then once
   again afterwards. or mark the code and then press the ‘code’ button. that keeps
   the code readable.
 * next step:
    if i am new to something, i start to read the available documentation:
 * [http://codex.wordpress.org/Customizing_the_Read_More](http://codex.wordpress.org/Customizing_the_Read_More)
 * [http://codex.wordpress.org/Template_Tags/the_excerpt](http://codex.wordpress.org/Template_Tags/the_excerpt)
   
   [http://codex.wordpress.org/Template_Tags/the_excerpt#Remove_.5B&#8230](http://codex.wordpress.org/Template_Tags/the_excerpt#Remove_.5B&#8230);.
   5D_string_using_Filters
 * if you plan to do more theme modification, it might be an idea to get yourself
   a few books about html and css, from the ‘dummies’ series for instance.
 *  Thread Starter [chefsherry](https://wordpress.org/support/users/chefsherry/)
 * (@chefsherry)
 * [16 years, 3 months ago](https://wordpress.org/support/topic/fixin-main-index-code/#post-1369991)
 * Thank you. I have spent most of the day reading the info you suggested. I thought
   I would do that before I bothered anyone here. I am sorry to say that I do not
   understand any of the code or where to put it.
 * I am almost near completing my site, so starting over is a tough decision. This
   was my last hope.
 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [16 years, 3 months ago](https://wordpress.org/support/topic/fixin-main-index-code/#post-1369995)
 * for a start, this is a copy of the original code:
 *     ```
       <?php the_content(''); ?>
       								<div class="readmorecontent">
       									<a class="readmore" href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>">Read More &raquo;</a>
       								</div>
       							</div>
   
       						</div><!--/post-<?php the_ID(); ?>-->
       						</div>
   
       				<?php endwhile; ?>
       ```
   
 * if you copy that back into place, hopefully the page will align again.
 * if you don’t want the ‘read more’, then the code would be:
 *     ```
       <?php the_content(''); ?>															</div>
   
       						</div><!--/post-<?php the_ID(); ?>-->
       						</div>
   
       				<?php endwhile; ?>
       ```
   
 * try this first and let us know how youget on ;-).
 *  Thread Starter [chefsherry](https://wordpress.org/support/users/chefsherry/)
 * (@chefsherry)
 * [16 years, 3 months ago](https://wordpress.org/support/topic/fixin-main-index-code/#post-1370009)
 * Okay, I tried the first original code with Read More and it worked! I was ready
   to marry you!!! LOL
 * So I figured I would try it without the read more and I am back to square one.
 * The ads/links on the right seem to shift to the bottom.
 * I must be the dumbest computer person on this planet! Ugh.
 * Do I need to leave a space before and after the code?
 * Thanks again for your assistance and patience!
 *  Thread Starter [chefsherry](https://wordpress.org/support/users/chefsherry/)
 * (@chefsherry)
 * [16 years, 3 months ago](https://wordpress.org/support/topic/fixin-main-index-code/#post-1370010)
 * This is what the code looks like now (sorry I didn’t think to send in last post):
 *     ```
       the_post_thumbnail(array(240,180), array("class" => "alignleft post_thumbnail")); } ?>
   
       <?php the_content(''); ?>
       								<div class="readmorecontent">
       									<a>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>">Read More &raquo;</a>
       								</div>
       							</div>
   
       						</div><!--/post-<?php the_ID(); ?>-->
       						</div>
   
       				<?php endwhile; ?>
       					<?php if(function_exists('wp_pagenavi')) { wp_pagenavi(); } else { ?>
       					<div class="alignleft"><?php
       ```
   
 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [16 years, 3 months ago](https://wordpress.org/support/topic/fixin-main-index-code/#post-1370027)
 * edit: my mistake – i indicated to delete one end div too many – 🙁
 * if you delete only this:
 *     ```
       <div class="readmorecontent">
       									<a>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>">Read More &raquo;</a>
       								</div>
       ```
   
 * that should work.
 * if it does not, leave it in, and ‘mask’ the ‘readmore’ with css:
 * in style.css, find (about line 246, before changes)
 *     ```
       .readmorecontent {
       	text-align: right;
           }
       ```
   
 * change it to:
 *     ```
       .readmorecontent {
       	text-align: right;
       visibility:hidden;
         }
       ```
   
 * that should render the ‘readmore’ invisible, without changing the structure.
 *  Thread Starter [chefsherry](https://wordpress.org/support/users/chefsherry/)
 * (@chefsherry)
 * [16 years, 3 months ago](https://wordpress.org/support/topic/fixin-main-index-code/#post-1370172)
 * Morning,
 * Thanks for the new edits. I tried all of them and they worked for the Read More,
   but they all still shift my sidebar from the right to the bottom.
 * I went with the original code you sent me for hiding the Read More.
 *     ```
       <?php the_content(''); ?>															</div>
   
       						</div><!--/post-<?php the_ID(); ?>-->
       						</div>
   
       				<?php endwhile; ?>
   
       					<?php if(function_exists('wp_pagenavi')) { wp_pagenavi(); } else { ?>
       					<div class="alignleft"><?php next_posts_link('&laquo; Older Entries') ?></div>
       					<div class="alignright"><?php previous_posts_link('Newer Entries &raquo;') ?></div>
       					<?php } ?>
       ```
   
 * I copied a little after to show what follows the code.
 * Is there anything else I could try before I have to completely give up and start
   over?
 * Thanks so much again…
 * Sherry
 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [16 years, 3 months ago](https://wordpress.org/support/topic/fixin-main-index-code/#post-1370186)
 * you said in one of your ealier post that putting the ‘readmore’ back in would
   give you the sidebar back in the right position.
 * you could try this again, and then put this into style.css:
 *     ```
       .readmorecontent {
       	text-align: right;
       visibility:hidden;
         }
       ```
   
 * there is no reason to think that this should change the position of the sidebar.
   i think you said you tried this before, but i am not quite sure with what result(?).
 * if this does not help, my assumption is that the misalignment of the sidebar 
   comes from a different part of the code.
 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [16 years, 3 months ago](https://wordpress.org/support/topic/fixin-main-index-code/#post-1370187)
 * i triple checked the last code you posted, and found that a line was missing 
   from it ( the div class navigation line):
 * the correction is here:
 *     ```
       <?php the_content(''); ?>															</div>
   
       						</div><!--/post-<?php the_ID(); ?>-->
       						</div>
   
       				<?php endwhile; ?>
       <div class="navigation">
       					<?php if(function_exists('wp_pagenavi')) { wp_pagenavi(); } else { ?>
       					<div class="alignleft"><?php next_posts_link('&laquo; Older Entries') ?></div>
       					<div class="alignright"><?php previous_posts_link('Newer Entries &raquo;') ?></div>
       					<?php } ?>
       ```
   
 *  Thread Starter [chefsherry](https://wordpress.org/support/users/chefsherry/)
 * (@chefsherry)
 * [16 years, 3 months ago](https://wordpress.org/support/topic/fixin-main-index-code/#post-1370196)
 * You are a life safer!!!
 * It works, it works, it works…
 * I am breathing a hugh sigh of relief and dancing around.
 * I cannot thank you enough for your help and patience.
 * With heart-felt thanks,
 * Sherry
 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [16 years, 3 months ago](https://wordpress.org/support/topic/fixin-main-index-code/#post-1370198)
 * well done – first time is always the hardest 😉
 *  Thread Starter [chefsherry](https://wordpress.org/support/users/chefsherry/)
 * (@chefsherry)
 * [16 years, 3 months ago](https://wordpress.org/support/topic/fixin-main-index-code/#post-1370218)
 * Hmm. I just discovered that three of my “pages” still have alignment issues. 
   I thought that by fixing the main template that would fix all of them. I should
   have checked all the pages–sorry. 🙁
 * Is the code that I changed in the style.css causing this?
 * Here are the links to those three pages:
 * [http://delicioushealthyfood.com/wp_Web/category/links/](http://delicioushealthyfood.com/wp_Web/category/links/)
 * [http://delicioushealthyfood.com/wp_Web/category/recipes/](http://delicioushealthyfood.com/wp_Web/category/recipes/)
 * [http://delicioushealthyfood.com/wp_Web/category/shopping/](http://delicioushealthyfood.com/wp_Web/category/shopping/)
 * Any suggestions?
 * Thanks again,
 * Sherry
 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [16 years, 3 months ago](https://wordpress.org/support/topic/fixin-main-index-code/#post-1370240)
 * edit archive.php and put another closing div `</div>` just before the line with‘
   endwhile’:
 * `<?php endwhile; ?>`
 * so it looks like:
 *     ```
       </div>
       <?php endwhile; ?>
       ```
   
 *  Thread Starter [chefsherry](https://wordpress.org/support/users/chefsherry/)
 * (@chefsherry)
 * [16 years, 3 months ago](https://wordpress.org/support/topic/fixin-main-index-code/#post-1370273)
 * You did it again! I am learning so much about coding that it’s scary.
 * I even changed some of my theme’s colors yesterday without doing too much damage.
 * On to more stuff…
 * Thanks,
 * Sherry

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

The topic ‘Fixing Main Index Code’ is closed to new replies.

 * 14 replies
 * 2 participants
 * Last reply from: [chefsherry](https://wordpress.org/support/users/chefsherry/)
 * Last activity: [16 years, 3 months ago](https://wordpress.org/support/topic/fixin-main-index-code/#post-1370273)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
