Image attachment page shows medium image size

resolved (7 posts) (2 voices)

  1. When viewing an image at its attachment page, the image is shown as a medium size, instead of being scaled to fit the content space. Why is this, and where should I look to change this?

    Example: http://christiaanconover.com/?attachment_id=4025

    HTML for the image:
    <img width="300" height="225" src="http://cdn.cconover.com/wp-content/uploads/2011/10/IMG_20111022_124511-300x225.jpg" class="attachment-medium" alt="N3USP's Antenna Mast" title="N3USP's Antenna Mast" />

    Posted 7 months ago #
  2. Elliott
    Support

    Hello cconover,

    Your link is giving me a 404. Your users shouldn't be able to view your attachments anyway unless they specifically type it out in the URL box or if your inserting your images with a Wordpress shortcode which in that case I would check out our own image shortcodes,

    http://mysitemyway.com/docs/index.php?title=Image_Frames
    http://mysitemyway.com/docs/index.php?title=Fancy_Images

    Posted 7 months ago #
  3. Whoops, it should be working now. The post that attachment to wasn't yet published, but you should be able to see it here: http://christiaanconover.com/cfb2011/img_20111022_124511/

    Posted 7 months ago #
  4. Elliott
    Support

    I'll assume that's the default Wordpress behaviour. Right now it's using our single.php template to display it but you can create an "attachment.php" template file to change the way it displays if you wish.

    Posted 7 months ago #
  5. Ok cool, thanks for the tip. I'm not familiar with that process, will Wordpress automatically use attachment.php if it detects the presence of that file?

    Posted 7 months ago #
  6. Elliott
    Support

    If you view an attachment page then it will go through the template heirarchy to figure out which template to use to display it. http://codex.wordpress.org/images/1/18/Template_Hierarchy.png

    By default our single.php template is being used but if you need to customize the way stuff is displayed then you can create your own attachment.php template and it will be used instead.

    Posted 7 months ago #
  7. Ok excellent, thanks for the information. I'll try it out.

    Posted 7 months ago #

Reply

You must log in to post.

Construct WordPress Theme
Construct wordpress theme
Myriad WordPress Theme
Myriad wordpress theme
Method WordPress Theme
Method wordpress theme
Fusion WordPress Theme
Fusion wordpress theme
Elegance WordPress Theme
Elegance wordpress theme
Echelon WordPress Theme
Echelon wordpress theme
Dejavu WordPress Theme
Dejavu wordpress theme
Modular WordPress Theme
Modular wordpress theme