WordPress.org

Ready to get started?Download WordPress

Forums

The "MORE" tag breaks my page (10 posts)

  1. annaselegance
    Member
    Posted 6 years ago #

    Hi, I've got a big problem that I don't know how to solve. I'm not a master coder but I know basic html and php. Now I'm in trouble though, I put the text in my blog posts inside tables and when I put a more tag

    <!--more-->
    into the text (which is inside a table) it completely ruins the layout of the page. Isn't there a smart way to work around this?

    What I'm aiming at is having a little text and the thumbnail to the right shown on the front page, and the rest (including the boxes like "More Pictures" or "Tech Specs") hidden till the reader presses the "Read more"-link.

    My blog is here: http://www.annaselegance.com/

    Thanks

  2. syrupcore
    Member
    Posted 6 years ago #

    don't use tables? :p

    seriously though, tables are just a path to pain. Google a bit on "css float" and see if that helps. http://css.maxdesign.com.au/floatutorial/

  3. annaselegance
    Member
    Posted 6 years ago #

    Thanks, I've tried to put together a test code in css float, but somehow "more" still messes up the layout.

    I put this into my style.css:

    #container
    {
    width: 90%;
    margin: 0px auto;
    background-color: #ff0000;
    color: #00ffff;
    border: 1px solid gray;
    }

    #rightnav
    {
    float: right;
    width: 150px;
    margin: 0;
    padding: 8px;
    }

    #articlecontent
    {
    margin-right: 160px;
    }

    And this code into the post called test code:

    <div id="container">
    <div id="rightnav">
    <p>
    Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut.
    </p>
    </div>
    <div id="articlecontent">
    <h2>Subheading</h2>
    <p>
    Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy ni...ate velit esse molestie consequat, <!--more-->vel illum dolore eu feugiat nulla facilisis...
    </p>
    <p>
    Ut wisi enim ad minim veniam,...
    </p>
    </div>
    </div>

    Any ideas?

  4. annaselegance
    Member
    Posted 6 years ago #

    I just deleted the more-tag so you can see it looks pretty decent without it, still no solution though...

    PS: Don't mind the colors, their just for testing purposes.

  5. annaselegance
    Member
    Posted 6 years ago #

    I found the answer, here it is: http://wordpress.org/support/topic/173144?replies=1

  6. annaselegance
    Member
    Posted 6 years ago #

    Hmm, thought I had solved it, but it turned out to only be half the truth. At least now the more-tag doesn't break the post layout and the text/picture margins, but what does happen, which is VERY odd, is that the sidebar is put into the #container when I insert a more-tag into the post. When there's no more-tag, the sidebar is not covered by the #container. Why does this happen?

  7. annaselegance
    Member
    Posted 6 years ago #

    I solved it, but ain't a lot of help around here... The solution was to move the

    <?php get_sidebar(); ?>
    up to the top in all the .php files and place it between content and contentmiddle. Like this:

    <div id="content">

    <?php get_sidebar(); ?>

    <div id="contentmiddle">

  8. mezmaghost
    Member
    Posted 5 years ago #

    A simple solution would be to add back in the </div> tag that it is cutting out.

    Goto the Main Index Template (index.php)

    Replace
    <?php the_content(__('Read more...', 'yourtemplatename')); ?>

    With
    <?php the_content(__('Read more...</div>', 'yourtemplatename')); ?>

    Let me know if this helps or if it breaks it for anyone?

  9. ericwichman
    Member
    Posted 5 years ago #

    Even simpler fix is this. In your index.php file of your theme located in /wp-content/themes/yourtheme/

    Just before the
    <?php get_sidebar(); ?>

    insert this: </div>

    This worked for me...

  10. glenngeiger
    Member
    Posted 5 years ago #

    mezmaghost: your idea to add a closing </div> tag to the end of the read more worked great. Thanks for the help!

Topic Closed

This topic has been closed to new replies.

About this Topic