Title: WP Get Post Image
Author: thewebist
Published: <strong>19 نوامبر 2009</strong>
Last modified: 26 ژوئن 2010

---

جستجوی افزونه‌ها

این افزونه **با ۳ نگارش عمدهٔ اخیر وردپرس آزمایش نشده است**. ممکن است دیگر نگهداری
یا پشتیبانی نشود و هنگام استفاده با نگارش‌های تازه‌تر وردپرس مشکل سازگاری داشته 
باشد.

![](https://s.w.org/plugins/geopattern-icon/wp-get-post-image.svg)

# WP Get Post Image

 توسط [thewebist](https://profiles.wordpress.org/thewebist/)

[دانلود](https://downloads.wordpress.org/plugin/wp-get-post-image.zip)

 * [جزئیات](https://fa.wordpress.org/plugins/wp-get-post-image/#description)
 * [نقد و بررسی‌ها](https://fa.wordpress.org/plugins/wp-get-post-image/#reviews)
 *  [نصب](https://fa.wordpress.org/plugins/wp-get-post-image/#installation)
 * [توسعه](https://fa.wordpress.org/plugins/wp-get-post-image/#developers)

 [پشتیبانی](https://wordpress.org/support/plugin/wp-get-post-image/)

## توضیحات

This plugin provides the template tag `wp_get_post_image()`. Use it to call dynamically
created images uploaded via the WordPress media uploader.

NOTE: This plugin is intended for use by WordPress developers and theme builders
only.

#### Usage

    ```
    <?php wp_get_post_image($args); ?>
    ```

#### Default Usage

    ```
    <?php $args = array(
        'width' => null,
        'height' => null,
        'css' => '',
        'parent_id' => '',
        'post_id' => '',
        'filename' => '',
        'return_html' => true       
    ); ?>
    ```

By default, the function returns:

 * The last uploaded image wrapped in an image tag (`<img />`).
 * A proportionately sized image with a `width` no greater than `200px`.
 * The CSS class `wp-image-*ID*` and no other classes.
 * If you add `thickbox` via `css`, the appropriate anchor `<a>` tag will be added
   for Thickbox compatibility.

#### Parameters

 * **width** (_integer_) – Width of image.
 * **height** (_integer_) – Height of image.
 * **parent_id** (_integer_) – The ID of the `post_parent` for the attachment. Specifying
   the `parent_id` returns the first image attached to the parent post according
   to `menu_order`.
 * **post_id** (_integer_) – The ID of the attachment.
 * **filename** (_string_) – The filename that corresponds to the `post_name` of
   the attachment.
 * **return_html** (_boolean_) – `true` returns the image wrapped in an XHTML image
   tag. `false` returns the image’s URL.

#### Example

    ```
    <?php 
    // use this example wherever you have access to $post->ID, e.g. the WordPress loop
    if(function_exists('wp_get_post_image'))
        echo wp_get_post_image('width=450&css=alignleft&parent_id='.$post->ID);  
    ?>
    ```

## نصب

Install the plugin as follows:

 1. Upload the folder `wp-get-post-image` to the `/wp-content/plugins/` directory
 2. Activate the plugin through the ‘Plugins’ menu in WordPress
 3. Place `<?php echo wp_get_post_image(); ?>` in your templates

## سوالات متداول

No questions yet.

## نقد و بررسی‌ها

نقد و بررسی‌ای برای این افزونه یافت نشد.

## توسعه دهندگان و همکاران

“WP Get Post Image” نرم افزار متن باز است. افراد زیر در این افزونه مشارکت کرده‌اند.

مشارکت کنندگان

 *   [ thewebist ](https://profiles.wordpress.org/thewebist/)

[ترجمه “WP Get Post Image” به زبان شما.](https://translate.wordpress.org/projects/wp-plugins/wp-get-post-image)

### علاقه‌ مند به توسعه هستید؟

[کد را مرور کنید](https://plugins.trac.wordpress.org/browser/wp-get-post-image/)،
[مخزن SVN](https://plugins.svn.wordpress.org/wp-get-post-image/) را بررسی کنید، 
یا از طریق [RSS](https://plugins.trac.wordpress.org/log/wp-get-post-image/?limit=100&mode=stop_on_copy&format=rss)
در [گزارش توسعه](https://plugins.trac.wordpress.org/log/wp-get-post-image/) مشترک
شوید.

## گزارش تغییرات

#### 0.2 (2010-01-26)

 * Adjusted `$image->basepath` to reference `get_bloginfo('wpurl')` instead of `
   get_bloginfo('url')`. This makes the plugin work when WordPress is installed 
   in one directory while the blog displays in another. (HT: [Mike Cohen](http://mikecohenmedia.com/))

#### 0.1 (2009-11-23)

 * first version

## اطلاعات

 *  نگارش **0.2**
 *  آخرین به‌روزرسانی **16 سال پیش**
 *  نصب‌های فعال **100+**
 *  نگارش وردپرس ** 2.8.4 یا بالاتر **
 *  آزمایش‌شده تا **3.0.5**
 *  زبان
 * [English (US)](https://wordpress.org/plugins/wp-get-post-image/)
 * برچسب
 * [attachments](https://fa.wordpress.org/plugins/tags/attachments/)[function](https://fa.wordpress.org/plugins/tags/function/)
   [images](https://fa.wordpress.org/plugins/tags/images/)[post image](https://fa.wordpress.org/plugins/tags/post-image/)
   [template tag](https://fa.wordpress.org/plugins/tags/template-tag/)
 *  [نمایش پیشرفته](https://fa.wordpress.org/plugins/wp-get-post-image/advanced/)

## امتیازها

هنوز هیچ نقدی ارسال نشده است.

[Your review](https://wordpress.org/support/plugin/wp-get-post-image/reviews/#new-post)

[مشاهده همه بررسی‌ها](https://wordpress.org/support/plugin/wp-get-post-image/reviews/)

## مشارکت کنندگان

 *   [ thewebist ](https://profiles.wordpress.org/thewebist/)

## پشتیبانی

چیزی برای گفتن دارید؟ نیاز به کمک دارید؟

 [مشاهده انجمن پشتیبانی](https://wordpress.org/support/plugin/wp-get-post-image/)

## کمک مالی

آیا تمایل دارید از پیشرفت این افزونه حمایت کنید؟

 [ کمک مالی به این افزونه ](http://michaelwender.com)