• Resolved aniultima

    (@aniultima)


    Hello,

    I’m running a blog at https://www.designdraft.net. Ever since creating the current layout, I’ve toyed with different methods of essentially making two “The Excerpts” for my posts.

    You see, the box on the right side is meant to be a place for articles to reside. Its designed so that only the image from the article is displayed – I place the (more) tag right after the image for this effect.

    However, when I display these articles in the main feed, it looks weird with just an image and no text, so I’ve doomed the special Articles to a category so that they’d show up only in that sidebar.

    This isn’t how I imagined it to work though, so I was wondering if anyone could help me achieve my desired effect? In a nutshell, I want a way to display the same posts in the main feed and the sidebar simultaneously, while one has the image + text Excerpt, and the other has only an image Excerpt.

    Thanks a lot!!

Viewing 5 replies - 1 through 5 (of 5 total)
  • Hopefully you’ll find this plugin called ‘Get Post Image‘ useful, but I’m a little unsure if it works with the latest version of WordPress.

    Thread Starter aniultima

    (@aniultima)

    Thanks a lot. That did the trick!

    One question though, I’m trying to make the images link to the post, but I’m getting an odd symbol instead of the permalink. Here’s the code:

    <?php $image_tag = gpi_get_image(0,"https://www.myserver.com/default.jpg", "post-image");
    		$url = get_permalink();
    		echo "<a href=’$url’>$image_tag</a>";
    		?>

    Any idea? I’m sure it’s fairly simple but I can’t quite figure it out.

    Glad it worked, and thanks for the feedback ??

    The apostrophes look a little strange. I think it should be something like
    echo "<a href='$url'>$image_tag</a>";
    or
    echo "<a href=\"$url"\>$image_tag</a>";

    Hope this helps ??

    Thread Starter aniultima

    (@aniultima)

    Yep! That did the trick. You’re my hero!

    Thanks a lot.

    It’s looking good! And you’re welcome – a big thanks to the plugin author really ??

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Display two different excerpts per post?’ is closed to new replies.