Wordpress custom field image value

3 replies
  • WEB DESIGN
  • |
Hi all,

healthandprosperity. com . au / services

I'm trying to set hyper links on each image on this page to go to the page itself (just like their titles do) but it only takes me to actual image URL.

I was custom field "image" with value of image url.

Is there a way around it?

Thanks
Andrey
#custom #field #image #wordpress
  • Profile picture of the author Aare
    open your dashboard, media library, then click on the image you want, then see the image link url
    Signature
    God bless us all!
    {{ DiscussionBoard.errors[2339773].message }}
    • Profile picture of the author andreypod
      Image wasn't added via media library - it was added as Custom Field "image" with value of image url. It was the only way to get it displayed as I needed.
      {{ DiscussionBoard.errors[2339791].message }}
  • Profile picture of the author ImmediateAction
    G,day Andrey,

    Yes there is a way around this.

    The issue is that your WordPress theme (Bigbusiness) is using Custom fields to assign images to posts, which is not a very good way to do this. Consequently you have the issue of inflexibility with the image url.

    Your theme files need to be edited and your WordPress version updated to the latest 3.0 so that instead of using a Custom field function for this, your theme files should be coded to be using the Post Thumbnail Images function (available since wp 2.9).

    This is done by editing the theme file that displays the Services page - here the relevant wordpress loop php code would be changed to remove any custom field php code related to the display of the images, and replaced with post_thumbnail php code.

    Your functions.php will then need to be edited to support post thumbnails.

    Finally you would then go back to the posts and remove the old custom fields, and then use the Thumbnail box (which will now exist because of the added code in the functions.php) to allocate the images which will be auto linked to the post.

    Details on how the WordPress Thumbnail functionality works can be found here:
    New in WordPress 2.9: Post Thumbnail Images Mark on WordPress

    As you'll notice from the above link - your thumbnail php in the theme files will need to be customized somewhat in order to show your images in the correct size etc.

    It sounds like a lot to do - but it is fairly straight forward, and won't take long to change your files. PM me if you need any help with this Andrey.

    Regards,

    Leon.
    {{ DiscussionBoard.errors[2340906].message }}

Trending Topics