WordPress.org

Ready to get started?Download WordPress

Forums

set Featured Image with Custom Field (14 posts)

  1. danieltoner
    Member
    Posted 3 years ago #

    My script sets the Featured Image automatically using a Custom Field tag. What is the tag for "Featured Image" now? I used to use "thumbs" but that was with an old template and pre-wp3. Now wp3 has its own thumbnails/featured images, it has to have a custom tag that links straight to it so the script can set it. Any idea on what that custom field tag is?

  2. danieltoner
    Member
    Posted 3 years ago #

    Set Featured Image url with a custom field.. anyone? I'm sure WP3 already has a custom field set for this and ready to go but I don't know the name of it and almost all documentation I can find is outdated.

    So in a post, I enter:

    Custom_Field_Name Value: http://www.link.to/featured_image_for_this_post.jpg

    What is Custom_Field_Name?

  3. DigitalSquid
    Member
    Posted 3 years ago #

    Try 'thumbnail'

  4. danieltoner
    Member
    Posted 3 years ago #

    tried that first.

  5. alchymyth
    The Sweeper & Moderator
    Posted 3 years ago #

    My script sets the Featured Image automatically

    check the code of your script - the custom field key name should be in there somewhere.

    theme name? download link?

  6. danieltoner
    Member
    Posted 3 years ago #

    it's a wordpress custom field I need, the script simply provides a url to a thumbnail which is the value, the custom field is a wordpress custom field. Used to be "thumbs" but now they changed it.

  7. danieltoner
    Member
    Posted 3 years ago #

    any other ideas?

  8. alchymyth
    The Sweeper & Moderator
    Posted 3 years ago #

    forget the idea that wordpress has a custom field for thumbnails - this is down to the theme author.

    if you look into index.php or single.php of your theme where you expect the thumbnail to show, somewhere in the code there has to be a reference to the custom field key name.

    if you would like help with it, you could paste the code from index.php and/or single.php into a http://wordpress.pastebin.com/ each and post the link(s) to it here.

    or at least post the name of your theme if it is a free theme; for premium themes contact the seller.

  9. danieltoner
    Member
    Posted 3 years ago #

    free theme: calotropis

  10. alchymyth
    The Sweeper & Moderator
    Posted 3 years ago #

    from the theme options, it seems that the custom filed name for the thumbnail is still 'thumb', although it is not totally clear if this is only for wp2.9 (?):

    Posts Thumbnails

    Thumbnails/images on index page, categories pages, archive pages, etc. Not including thumbnails on single post or single page.

    In WordPress 2.9 and later, Post Thumbnail and Featured Images are croped to fit these values. Both are set via post-thumbnail feature using same image.

    In WordPress prior to 2.9 you can set post-thumbnai using Custom field. The name is thumb. You can enter the attachment-ID if the image or the URL of the image. If attachment-ID is set in thumb custom field, the system will use the attachment image and resize them to fit these sizes set below using CSS. If thumb custom field value is an URL, the system will use timthumb to crop the image to fit these sizes set below.

    using wp3, i did not have any luck using the custom field method to generate a thumbnail image for the front page.

    however, setting 'featured image' in the 'post edit' screen turns this image into the thumbnail, and worked for me in wp3.

  11. yodibashi
    Member
    Posted 3 years ago #

    Hello, maybe someone can help me!

    I have a free theme,that provides featured images.
    But what i want is to link the featured image to a custom URL.
    I understood this could be done with custom fields?
    But how to?
    The free template I am using (which is a great template by the way) is available here:

    http://www.flexible7.com/bluebubble-wordpress-theme/

    Thanks for helping!

  12. jadassary
    Member
    Posted 3 years ago #

    Basically all what you need to use it in your theme is this:

    <?php the_post_thumbnail(); ?>

    but it could contain other setting to make your life better :P

    <?php the_post_thumbnail('thumbnail'); ?> // thumbnail size
    <?php the_post_thumbnail('medium'); ?> // medium size
    <?php the_post_thumbnail('large'); ?> // large size

    But What if you need to use your own size? Well, WP Never let you Down :)
    <?php the_post_thumbnail(array( 200,200 ); ?>
    What about Css and Classes ? You Got it Baby, you got it !!

    <?php the_post_thumbnail(array( 200,200 ), array( 'class' => 'alignleft' )); ?>

    I Hope That Could Work for you :)

  13. danijelpendjer
    Member
    Posted 3 years ago #

    Thanks jadassary! Thanks for help. I just put this code in custom fields:

    <?php the_post_thumbnail('thumbnail'); ?>

    Great :)

  14. alugonja
    Member
    Posted 3 years ago #

    Hey danijelpendjer

    I am not sure that is going to work if you are trying to pull thumbnail image from your sub-blog posts?

Topic Closed

This topic has been closed to new replies.

About this Topic