Topic: Template tag shows the attached images?

Hi there,

I have a custom post type for products, and I need a simple way to add a group of images that are automatically shown somewhere in the product page (e.g. using template tag). So I am looking now for a template tag, or even shortcode that can be inserted in the text widget, that shows the images attached to the post (that said, without the needing to specify the post id in the shortcode or so). This way I need just to attach the images with the product to get them shown without manually inserting the shortcode everytime.

So... can I get this functionality with SimpleViewer plugin?

Thanks in advanced,

Re: Template tag shows the attached images?

A sample entry for a SimpleViewer gallery in WordPress would look something like this:

[simpleviewer gallery_id="53" bgcolor="336699" gallery_width ="800" gallery_height ="600"]

The gallery_id refers to a specific XML file which lists the images to be displayed.
If I understand correctly, you are looking for an entry such as:

[simpleviewer bgcolor="336699" gallery_width ="800" gallery_height ="600"]

... which would simply display the images attached to the post in question.
If that is correct, then the SimpleViewer WordPress plugin will not suit your purposes as it does not function that way.

Steven Speirs
SimpleViewer Support Team

3 (edited by mamouneyya 2010-10-19 19:37:25)

Re: Template tag shows the attached images?

That is right. I want to insert a general tag/shortcode for showing the attached images with the post, with no dependancy on the post it-self.

Well. Just thinking... can we figure that out by using some php function to automatically fill that field? I mean, is there a simple way to know the gallery id for the images attached to the post we're currently in? (e.g. [simpleviewer gallery_id="<?php echo this.gallery_id() ?>" ... ])

Please not that I have not really php knowledge, so it's just a thought! :/