• Hello,

    I use the WP Admin panel to letting display the 6 latest blog entries at my “home”page. Now I´ve severeal problems displaying the latest 8 entries on a subpage using the following code:

    <?php if (have_posts()) : ?>
    <?php while (have_posts()) : the_post(); ?>
    <?php
    $posts = get_posts('numberposts=8');
    foreach ($posts as $post) :
    ?>
    <h4><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h4>
    <div class="post-main">
    <?php <strong>the_content</strong>('Read �'); ?>
    </div>
    <p class="custom"><?php the_time('d. F Y ') ?> filed under <?php the_category(', ') ?> <?php edit_post_link('Edit','',''); ?>
    <?php
    endforeach;
    ?>
    <?php endwhile; ?>
    <?php else : ?>
    <h4>Not Found</h4>
    <?php endif; ?>

    Everything´s fine if I replace the_content with the_excerpt but that´s not what´s intended. Please feel free to help me out 🙂

Viewing 4 replies - 1 through 4 (of 4 total)
  • <?php <strong>the_content</strong>('Read �'); ?>

    Should read something like:

    <?php echo "<strong>".the_content."</strong>"; ?>

    I’m not sure what you intend with the Read bit on the end but regardless what you had was invalid PHP, the strong tags are HTML not PHP, alternatively you could use:

    <strong><?php echo the_content;?></strong>

    Thread Starter swooper

    (@swooper)

    My intention was to emphasize the “the_content” part that anyone can take a quick scan..the php should be right the Read is what is going to be displayed if use the more tag while posting a new entry..To sum up strong or the php echo, sadly, are not the problem..

    Thread Starter swooper

    (@swooper)

    Does nobody know anything about this?

    Bad English is obviously hard to understand. Perhaps you can rephrase your question.

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

The topic ‘the_content problem’ is closed to new replies.