• 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: https://www.annaselegance.com/

    Thanks

Viewing 9 replies - 1 through 9 (of 9 total)
  • 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. https://css.maxdesign.com.au/floatutorial/

    Thread Starter annaselegance

    (@annaselegance)

    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?

    Thread Starter annaselegance

    (@annaselegance)

    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.

    Thread Starter annaselegance

    (@annaselegance)

    Thread Starter annaselegance

    (@annaselegance)

    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?

    Thread Starter annaselegance

    (@annaselegance)

    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”>

    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?

    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…

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

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘The “MORE” tag breaks my page’ is closed to new replies.