• Hi!

    I have a problem with the the_content() function on single.php and page.php. it worked perfectly until i transferred the whole wp installation to a different directory (with subdomain) on the webserver.

    i did the transfer according to the manual here on wordpress.org and everything worked fine – except: the_content() doesn’t show anything. the_title() and so on are working fine…

    do you have any ideas what the problem could be?

    here’s the code from single/page.php:

    [code moderated as per forum rules - please use the pastebin.
    if you post small amounts of code directly, mark it with the 'code' button or using backticks]

    greets,
    mario

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter Neo_II

    (@neo_ii)

    Okay,

    I found out 2 more things:
    – it didn’t work before the transferring on the server as well
    – the_content works if i create a new page. it doesn’t work with existing pages

    any ideas? could it be a problem in the database?

    I am having this same issue, only it did work before I switched the WP to another directory and reinstalled. I have no idea why this is happening since nothing regarding that code has been changed.

    because you need a loop

    on the single page or page place

    <?php if (have_posts()) : ?>
    <?php while (have_posts()) : the_post(); ?>
    <?php the_content(); ?>
    <?php endwhile; ?>
    <?php endif; ?>

    and ready to go

    Thread Starter Neo_II

    (@neo_ii)

    I have a loop on the pages. It’s just, that the_content() doesn’t work on certain old pages. If i add a new page in the backend, everything works like a charm…

    @neo_ii
    can you post a link to a page of each kind ?

    have you checked, if the content shows in the html code in the browser?

    can you see a common factor in the pages that do not show the content?
    they might, for instance, all be pure image posts, or have something embedded (video) ?

    or maybe a plugin is causing this, have you checked that?

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

The topic ‘the_content() doesn't work on single and page.php’ is closed to new replies.