Support » Fixing WordPress » Adding Image to Home Page From Post

  • Hi there,

    I am trying to get an image from posts added to the home page.

    Basically, Each of my posts have an image at the begining, however they do not show up on the home page.

    I am using shortened descriptions on the home page which calls content using <?php echo $content; ?>

    can anyone tell me how to do this please.

    Thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • Further to my last, this is the complete snipet used to get the content.

    <?php
    $content = get_the_content(‘Continued »’);
    if (strlen($content) > 200 && !eregi(“Continued &raquo”, $content)) {
    $content = substr(strip_tags($content), 0, 200) . “…”;
    }
    $i++;
    ?>

    ok, I am moving forward with my playing…….

    I have removed the following:

    {
    $content = substr(strip_tags($content), 0, 200) . “…”;

    }

    Now, homepage shows the image from the post. However How do I now restrict the amount of text, as it is displaying the whole post on the hompage and not just a snippet.

    So lets say I want to show 100 words on the homepage for the post. What do I need to add to the code for this to happen?

    Thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Adding Image to Home Page From Post’ is closed to new replies.