Skip Navigation

[Resolved] Layout View for attachment dont`t show image

This thread is resolved. Here is a description of the problem and solution.

Problem: I would like to create a Layout for Media attachment pages, but I can't get my image to show up.

Solution: Add the following attachment link shortcode:

add_shortcode('wpv-attachment-link', 'attachment_link_shortcode');
function attachment_link_shortcode ($atts) {
  global $post;
  return wp_get_attachment_image_src($post->ID, $atts['size'])[0];
}

Use the shortcode like so:

[wpv-attachment-image size="large"]

Now each image is displayed as a link to the attachment.

This support ticket is created 7 years, 2 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 7 replies, has 2 voices.

Last updated by Ronny Wunderlich 7 years, 2 months ago.

Assisted by: Christian Cox.

Author
Posts
#569552

I am trying to: I like to show an attachment view with image, beacause when i search in Google i find my attachment site, but she is only white.

Link to a page where the issue can be seen: hidden link

Instead, I got: I cant see the Image. I insert it with the [wpv-post-featured-image size="full"] shortcode. But it doesnt work.

#569567

Hi, can you post a screenshot that shows where you have added this shortcode in wp-admin? I would like to get a bit more information about how you have implemented it. Please show the entire page in wp-admin where the shortcode is included. Then, please show a screenshot of the featured image in this post in wp-admin:
hidden link

#569604
Screenshot-2017-9-13 Layout bearbeiten ‹ Ronny Wunderlich Fotografie — WordPress.png

Hi, i make a Layout, put the shoortcut in this Layout and use it for media attachements. Here is e screenshoot.

#569608

Try adding a post content cell to your Layout.

#569689

I try, but not work.

#569705

That should work, can I take a look in your wp-admin area to see what's going wrong? Please share login credentials in the private reply fields here.

#569821

Okay thanks, it seems to be set up correctly so I'm not sure what's going on. Can you try the following troubleshooting steps?
- Temporarily disable all non-Toolset plugins and activate a default theme like Twenty Seventeen
- If the problem is resolved, reactivate your theme and plugins one by one until the conflict is revealed
- If the problem is not resolved, I may need to create a clone of your site so I can run some more tests without changing your site's live content. I will use the Duplicator plugin to create this clone. Let me know if that's okay.

#569912

Hi, i test with other template and it works.

Now i use a code from https://toolset.com/forums/topic/media-overview-shows-image-twice/page/2/#post-560140

Now it works for me.

Thx