DISQUS

Fun with WordPress: Easy Peasy Images Suggestion Roundup

  • inspirationbit · 11 months ago
    Thanks a lot for updating the code with so many helpful changes. I just replied to your comment on the previous post and then saw your tweet about the updates. The video was helpful too. Great job, Andrew!
  • Michael · 11 months ago
    I have a similar script running on wpengineer.com.For the default images i use a handwritten array. Your idea with saving the default images in the options is better.
    One idea:
    Allow more images to a category and use something like array_shuffle to select a random image .

    Thank you,
    Micha
  • tonygray216 · 11 months ago
    Will this show all images attached to a post? The code looks like it does but I'm only seeing the first one.
  • Andrew Rickmann · 11 months ago
    No it will only show one. This is a replacement for the custom field technique not a replacement for the gallery shortcode.
  • Danno · 10 months ago
    Nice. Thanks!
  • Danno · 10 months ago
    Question if I may ... how does one change the dimensions at which the images are displayed? I'm particularly interested in changing the dimensions of 'medium'.

    Thanks in advance.
  • tom (dB) · 10 months ago
    you do that in your wordpress settings under Geberal > Media
  • danjothebanjo · 10 months ago
    Hi Andrew, this code looks like just the ticket for me. Being new to WordPress I've found it frustrating how "buried" all this access to post images is - and had no joy on the WP support forums.

    How can I use your the-image tag outside of the loop? e.g. to display the first image attached to a specific post on my static homepage. I'm currently using a custom-field but I'd prefer to create a unique post to manage this image element on my homepage - it'll bjust be much easier for my non-techy client to manage!

    Thanks for generously posting your code.

    Dan
  • Andrew Rickmann · 10 months ago
    Dan, the functions within the loop depend on the $post global variable being set. If it is set then the function should work. However, the usual way is to create a new loop containing the posts you want, and then use it as normal.

    This page should help: http://codex.wordpress.org/The_Loop#Multiple_Lo...