• A strange thing is happening on one of my pages. I have some HTML to display a 15 x 15 grid of images with a background image behind them. I have generated and checked the code before pasting it into the html editor, and I can see my grid with images in the admin area. But when I preview or publish the page, it’s empty. Nothing is being displayed on the page – there’s no HTML where the content should be.

    Can anyone shed any light on this?

    Thanks

Viewing 12 replies - 1 through 12 (of 12 total)
  • Try the code by itself on a page template instead of in the post editor.

    Thread Starter notbanksy

    (@notbanksy)

    Hi – thanks for your reply.

    The code works fine when it’s hard coded to a page template.

    The only thing I can think of which WP might be objecting to is my use of HTML comments, which I’ve done to keep track of the different rows of images as it’s such a long piece of markup. Could this be the cause?

    Check the source of your rendered page; WP sometimes dumps in carraige returns. Might have to remove all the white space in the code. Do you have full paths on the images?

    Thread Starter notbanksy

    (@notbanksy)

    I’ve already removed all the carriage returns. The rendered page is simply blank in terms of code where content should be, so I’m baffled…

    O_o

    Try validating the code with direct input: https://validator.w3.org

    Thread Starter notbanksy

    (@notbanksy)

    Thank you for suggesting that! I validated the code I was putting into the database, but I has overlooked an error that had crept into my template. Seems to be working now. ??

    Thread Starter notbanksy

    (@notbanksy)

    [edit]

    Grrr! Now the images are showing, but there is a new problem. The grid of images is for a competition where squares are sold to entrants and a raffle takes place at the end.

    So I have 2 images: empty.gif and full.gif. At the moment all the squares are displayed as empty.gif. If I try to change one of the squares to full.gif, the change takes place in the admin page, but not in the preview or published page….

    Any more thoughts?

    Check image paths. Empty cache. Disable caching of images in .htaccess.

    Thread Starter notbanksy

    (@notbanksy)

    I am an arse!

    I forgot to change the template back to the standard one – that’s why the image changes weren’t showing.

    But now I am back to my original problem….

    What does the page source show? Anything?

    Thread Starter notbanksy

    (@notbanksy)

    It only shows the template HTML. Where the content should be, there’s nothing.

    Thread Starter notbanksy

    (@notbanksy)

    Could it be something wrong with the database? I’ve installed the latest version of wp onto my local server and hooked it up to a copy of the database in question and I’m having the same problem…

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Content shows in back end only’ is closed to new replies.