Title: Showing code?
Last modified: August 22, 2016

---

# Showing code?

 *  [demeter_aurion](https://wordpress.org/support/users/demeter_aurion/)
 * (@demeter_aurion)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/showing-code/)
 * I’ve got the plugin installed and working, added two images as attachments to
   a post. When I view the post, instead of displaying the images it just shows 
   some PHP code in a box? Is this the intended functionality of this plugin or 
   am I missing something?
 * [https://wordpress.org/plugins/attachments/](https://wordpress.org/plugins/attachments/)

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

 *  [amebix](https://wordpress.org/support/users/amebix/)
 * (@amebix)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/showing-code/#post-5737361)
 * I am having the same exact issue as the above poster…6 months later.
    Did anyone
   happen to resolve this or is there something maybe I’m doing wrong?
 * I am using it with a custom post type and everything else seems to be working
   fine, except for the fact the images are not being displayed that I attach, just
   the PHP code for the attachment is being displayed. It also does the same thing
   for other kinds of attachments.
 * For people’s information, I do have the MediaVault plugin enabled turned on, 
   since sometimes sensitive data might get uploaded into the Media Gallery. However
   same issue is being seen with both protected files and non protected files.
 * Would be amazing if I could figure this out, as this plugin might help me immensely
   on this project.
 * Thanks so much!
 *  Plugin Author [Jon Christopher](https://wordpress.org/support/users/jchristopher/)
 * (@jchristopher)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/showing-code/#post-5737362)
 * Hi all, can you share with me what code you’re using? If you are using this sample
   code from the docs [https://github.com/jchristopher/attachments/blob/master/docs/usage.md#pulling-attachments-to-your-theme](https://github.com/jchristopher/attachments/blob/master/docs/usage.md#pulling-attachments-to-your-theme)
   it is designed to print out the variable holding all of the Attachments data.
   To retrieve specific attributes to use in your theme there are some utility methods
   you can use here: [https://github.com/jchristopher/attachments/blob/master/docs/usage.md#retrieve-attachment-attributes](https://github.com/jchristopher/attachments/blob/master/docs/usage.md#retrieve-attachment-attributes)

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

The topic ‘Showing code?’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/attachments_fafafa.svg)
 * [Attachments](https://wordpress.org/plugins/attachments/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/attachments/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/attachments/)
 * [Active Topics](https://wordpress.org/support/plugin/attachments/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/attachments/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/attachments/reviews/)

## Tags

 * [code](https://wordpress.org/support/topic-tag/code/)
 * [images](https://wordpress.org/support/topic-tag/images/)
 * [pre](https://wordpress.org/support/topic-tag/pre/)

 * 2 replies
 * 3 participants
 * Last reply from: [Jon Christopher](https://wordpress.org/support/users/jchristopher/)
 * Last activity: [10 years, 8 months ago](https://wordpress.org/support/topic/showing-code/#post-5737362)
 * Status: not resolved