Support » Requests and Feedback » Automatically generate image with new post

  • I would like to have an image that I can post on other websites that will show my most recent post. I figure the best way to do this would be to call a script that creates an image with the post title called newPost.jpg when create a new post. This way I drop the image code on a site and it always shows the most recent post no matter what.

    But I can’t find how to do this. Can I be the first person to think of it? Certainly not, I hope.

Viewing 5 replies - 1 through 5 (of 5 total)
  • If you’re using PHP, it needs to be compiled with GD support in order to create a jpg. Why would you use an image for this? Why not just grab the text itself?

    Because it would need to be compatible with Myspace. Is there a way to grab the text using just HTML?

    Technically, you could with an iframe, though that’s not a great way of doing things, and I’m not sure if Myspace allows iframes.
    Why not just have your RSS feed in your Myspace page?

    I’d really rather have an image instead of a swf. Are there any plugins that you guys know of that will auto generate an image? That I can use and tweak to get the desired effects with a little tweaking.

    Moderator Samuel Wood (Otto)

    (@otto42) Admin

    You could do this with some custom code. I can give you an idea of how, writing the code itself would take a lot more time.

    First, learn some basic PHP. Look for PHP code tutorials and such. Read them.

    Second, read this webpage. It tells you, generically, how to create an image on the fly with text in it. Make something like that, with temporary text that you want to use.

    Once you’ve got that working, all you need to do is to modify your script to use the latest post title instead of the temp text you used. To do that, you add code like this to it:

    if( have_posts()) {
    $title = get_the_title();

    That will get the latest title into $title, which you can then use in your own image generation code.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Automatically generate image with new post’ is closed to new replies.