logo
Ask your WordPress questions! Pay money and get answers fast! (more info)

Warning: Please do not give out any FTP or ssh credentials to anyone, unless you trust them completely. Giving out login details is dangerous.

If the asker does not get an answer then they have 10 days to request a refund.

$20
WP Featured Images

I have a strange issue, which is that I have a set of posts that are recipes, but I would like to have the same image in the post as the featured image.

Is there a way to do this with a database script or within the database?

gmellett | 11/03/11 at 2:16pm Edit
Tutorial: How to assign prize money


(7) Possible Answers Submitted...

See a chronological view of answers?

Warning: Please do not give out any FTP or ssh credentials to anyone, unless you trust them completely. Giving out login details is dangerous.

  • avatar
    Last edited:
    11/03/11
    2:21pm
    Fahd Murtaza says:

    Please explain what do you mean by " have the same image in the post as the featured image."

    Previous versions of this answer: 11/03/11 at 2:21pm

    • 11/03/11 2:29pm

      gmellett says:

      sorry for the confusion.

      1. I am running a recipe plugin that inserts an image, but the recipe itself is just a set of microformatted data that needs to be inserted into a post to display.
      2. the post calls the recipe data block using a short code
      3. The net result is that the post that has a recipe within it.

      the issue is that I created a summary page that will automatically bring in posts and display the excerpt and featured image thumbnail.

      The problem is that the post types do not have a featured image yet because it is actually in the recipe plugin data set.

      I have the image and image path, so I was wondering if there was a way to automatically insert the image path of the featured image, but I can't find where in the database the URL is called.

      Hope that makes sense.

    • 11/03/11 2:34pm

      Fahd Murtaza says:

      OK

      If I understand your question right, try this plugin

      http://wordpress.org/extend/plugins/add-post-thumbnail-shortcode/

      Adds a [post_thumbnail] shortcode for use with wordpress post thumbnails. Also accepts [post_thumbnail size=""].

      Just insert the shortcode into any post's content and when it will be replaced with the featured image.

      This works only with the featured images introduced in WordPress 2.9.

      So basically, you can use this short code anywhere within post content.

    • 11/03/11 2:37pm

      Fahd Murtaza says:

      OK

      I got your message after I posted the last one, so I understand what you want but it wont be easy without understanding how the recipe plugin is working.

  • avatar
    Last edited:
    11/03/11
    2:21pm
    Jens Filipsson says:

    You can show the featured image in your post, if that is what you mean. This code should do it. Add it to your single.php file:


    <?php
    // If WordPress 2.9 or above and a Post Thumbnail has been specified
    if ((function_exists('has_post_thumbnail')) && (has_post_thumbnail())) { ?>
    <?php the_post_thumbnail('medium', array('alt' => ''.get_the_title().'')); ?>
    <?php } ?>

    Previous versions of this answer: 11/03/11 at 2:21pm

    • 11/03/11 2:29pm

      gmellett says:

      sorry for the confusion.

      1. I am running a recipe plugin that inserts an image, but the recipe itself is just a set of microformatted data that needs to be inserted into a post to display.
      2. the post calls the recipe data block using a short code
      3. The net result is that the post that has a recipe within it.

      the issue is that I created a summary page that will automatically bring in posts and display the excerpt and featured image thumbnail.

      The problem is that the post types do not have a featured image yet because it is actually in the recipe plugin data set.

      I have the image and image path, so I was wondering if there was a way to automatically insert the image path of the featured image, but I can't find where in the database the URL is called.

      Hope that makes sense.

  • avatar
    Last edited:
    11/03/11
    2:24pm
    Luis Abarca says:

    i dont get it, you want to show the featured thumbnail in the post content ??

    If that is what you want you just need to add this before the_content() on the single.php


    ...
    if ( has_post_thumnail() ) {
    the_post_thumbnail('large'); // or medium, or any size you want
    }

    the_content();
    ...

    Previous versions of this answer: 11/03/11 at 2:24pm

    • 11/03/11 2:29pm

      gmellett says:

      sorry for the confusion.

      1. I am running a recipe plugin that inserts an image, but the recipe itself is just a set of microformatted data that needs to be inserted into a post to display.
      2. the post calls the recipe data block using a short code
      3. The net result is that the post that has a recipe within it.

      the issue is that I created a summary page that will automatically bring in posts and display the excerpt and featured image thumbnail.

      The problem is that the post types do not have a featured image yet because it is actually in the recipe plugin data set.

      I have the image and image path, so I was wondering if there was a way to automatically insert the image path of the featured image, but I can't find where in the database the URL is called.

      Hope that makes sense.

  • avatar
    Last edited:
    11/03/11
    2:24pm
    Hai Bui says:

    You can use this plugin http://wordpress.org/extend/plugins/auto-post-thumbnail/ to "Automatically generate the Post Thumbnail (Featured Thumbnail) from the first image in post or any custom post type only if Post Thumbnail is not set"

  • avatar
    Last edited:
    11/03/11
    2:26pm
    juan manuel incaurgarat says:

    remember that when you set the featured image, there is a button to insert that image on the post as well

  • avatar
    Last edited:
    11/03/11
    2:33pm
    Jatin Soni says:

    I usually use only this code to get featured image into post

    <?php the_post_thumbnail(); ?>


    This should get image from your featured image. If you have defined size you can assign it to display as below code.

    <?php the_post_thumbnail('large'); ?> 
    where large is your defined size code in function.php

    like below

    function.php
    add_image_size( 'large', 970, 9999); // Featured Big Image doesn't crop the image

    or
    add_image_size( 'large', 970, 400, true); // Featured Big Image crop the image

    Previous versions of this answer: 11/03/11 at 2:33pm

  • avatar
    Last edited:
    11/03/11
    4:11pm
    Clifford P says:

    I understand what you're asking. You need to pull from the plugin's data field. You're not asking about WP's built-in "featured image" functionality.

    I would test if Hai Bu's recommended plugin does the trick. If not, let us know which recipe plugin you're using and we can go from there.

    (Remember to backup before messing around - both files and database.)

This question has expired.





Current status of this question: Community pot



Please log in to add additional discourse to this page.





Warning: Please do not give out any FTP or ssh credentials to anyone, unless you trust them completely. Giving out login details is dangerous.

If the asker does not get an answer then they have 10 days to request a refund.