Sonya Lynn Designs

Blogging McBloggerson

  • About Me
  • My Blog
    • WordPress How To
    • WordPress Plugins
    • WordPress Themes
You are here: Home / Wordpress / Wordpress Themes / Genesis Theme Framework / Change Attachment Page’s Image Size In Genesis Theme

Change Attachment Page’s Image Size In Genesis Theme

October 20, 2014 by Sonya Lynn Designs 2 Comments

A couple of years ago, i figured out how to change the attachment page image size by editing a core wordpress file. This gets overwritten every time WordPress is updated which is not efficient at all. I’m using Genesis Theme Framwork for most of my websites, so here’s a quick fix that can be applied to the Genesis child theme.

Locate the functions.php page in the child theme, and add this chunk of code:

[code]
/*Change attachment page image size*/
add_filter('prepend_attachment', 'ag_prepend_attachment');
function ag_prepend_attachment($p) {
return '<p>'.wp_get_attachment_link(0, 'full', false).'</p>';
}
[/code]

Now the image should be full size instead of the default “medium” size.

Related

Filed Under: Genesis Theme Framework

Comments

  1. Tony says

    November 17, 2014 at 5:44 am

    I used this add_filter('prepend_attachment', 'ag_prepend_attachment');
    function ag_prepend_attachment($p) {
    return ''.wp_get_attachment_link(0, 'large', false).'';
    }

  2. Tony says

    November 17, 2014 at 5:46 am

    wordpress striped the p tags out

Leave a Reply Cancel reply