WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Fixing Main Index Code (15 posts)

  1. ChefSherry
    Member
    Posted 4 years ago #

    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/

    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

  2. alchymyth
    Forum Moderator
    Posted 4 years ago #

    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/Template_Tags/the_excerpt
    http://codex.wordpress.org/Template_Tags/the_excerpt#Remove_.5B....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.

  3. ChefSherry
    Member
    Posted 4 years ago #

    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.

  4. alchymyth
    Forum Moderator
    Posted 4 years ago #

    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 ;-).

  5. ChefSherry
    Member
    Posted 4 years ago #

    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!

  6. ChefSherry
    Member
    Posted 4 years ago #

    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
  7. alchymyth
    Forum Moderator
    Posted 4 years ago #

    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.

  8. ChefSherry
    Member
    Posted 4 years ago #

    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

  9. alchymyth
    Forum Moderator
    Posted 4 years ago #

    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.

  10. alchymyth
    Forum Moderator
    Posted 4 years ago #

    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 } ?>
  11. ChefSherry
    Member
    Posted 4 years ago #

    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

  12. alchymyth
    Forum Moderator
    Posted 4 years ago #

    well done - first time is always the hardest ;-)

  13. ChefSherry
    Member
    Posted 4 years ago #

    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/recipes/

    http://delicioushealthyfood.com/wp_Web/category/shopping/

    Any suggestions?

    Thanks again,

    Sherry

  14. alchymyth
    Forum Moderator
    Posted 4 years ago #

    edit archive.php and put another closing div </div> just before the line with 'endwhile':

    <?php endwhile; ?>

    so it looks like:

    </div>
    <?php endwhile; ?>
  15. ChefSherry
    Member
    Posted 4 years ago #

    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

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags