• Resolved Wayne

    (@waynep16)


    I have a custom post type “Property”

    I am showing users posts and it works

    [loop type=”property” author=”this” count=”1″]
    [field image]
    [field title]
    [field property_price]
    [/loop]

    But Featured image doesn’t show

    I have tried [field image] [image-url] [image] [image-link]

    nothing works inside the property loops :(]

    What am i doing wrong?

    https://ww.wp.xz.cn/plugins/custom-content-shortcode/

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Eliot Akira

    (@miyarakira)

    I checked the following, and they all seem to be working:

    [field image]
    [field image-url]
    [field image-link]
    [field thumbnail]
    [field thumbnail-link]

    Could it be that the property image is in a custom field? You can check in Dashboard -> Content, to see what fields exist for this post type.

    If it’s another field, you can try:

    [field image="field_name"]
    Thread Starter Wayne

    (@waynep16)

    Property custom post type has the following default tags

    author, date, id, image, slug, thumbnail, title, url

    But the way property images are stored is with post attachments , I’m guessing from the media post type …

    So within a property loop how can I show one of the media attachments ?

    And thank you for alerting me to the dashboard > content page. I didn’t even know that existed !

    Plugin Author Eliot Akira

    (@miyarakira)

    I see, so featured images are enabled for this post type. Still, it’s possible they’re being saved as attachments. If so, you can try..

    [loop type="property" ..]
      [attached]
        [field image]
        [field url]
      [/attached]
    [/loop]

    Description of [attached] is under Settings -> Custom Content -> Attached.

    I hope that works!

    Thread Starter Wayne

    (@waynep16)

    YES !!! i love you !

    How can i return just one instead of all ?

    and show thumbnail size instead of full ???

    Then ill leave you alone

    thank you

    Plugin Author Eliot Akira

    (@miyarakira)

    Great, I’m glad we’re closer to a solution. You can show just one thumbnail like this:

    [loop type="property"...]
      [attached count="1"]
        [field thumbnail]
      [/attached]
    [/loop]

    This will show the newest attached image. For details, please see the documentation under Settings -> Custom Content -> Attached.

    Thread Starter Wayne

    (@waynep16)

    Amazing, thank you.

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Show featured image in loop’ is closed to new replies.