• Hi All !!!
    I have just encountered to some troubles with loading pictures and assigning them to current post.

    I’d like to explain what I want:
    I have created post then I want to assign some pictures to this post. They (loaded pictures) must be shown into separate block , for example into sidebar.php when looking over the post. In my case loaded pictures are screen shots of reviewed product as a result such variant as loading them with help of visual editor doesnt fit for.

    Maybe I will have ability to assign them from Gallery to the post ? At present I see one variant how to realize it. I can load pictures via visual editor to post then before showing post at front end I will take all images with path with help of regular expression PHP , storage them to variable, remove them from post and show them in any separate block. It will work 100% but to my mind It’s hard for system.

    Please let me know can I realize it (loading pictures and assign them to post) with any other ways.

    Thanks a lot in advance.

    P.S. Each posts may contain its own pictures.

Viewing 2 replies - 1 through 2 (of 2 total)
  • You will need to upload the pictures whilst in the relevant Add New/Edit Post admin page in order to create/store the post/image association. Once that associations has been created, you can use function such as wp_get_attachment_image_src to grab & display post-specific images.

    Upload the images to the gallery. Assign them to the post using a custom meta tag with a keyword like sidebar_image and the image url as the value. Then create a widget to echo the picture. This should work pretty well for single post displays. If you want to echo a picture as you scroll over a series of posts you’ll probably need javascript.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to upload some pictures and to assign them to the post’ is closed to new replies.