- This topic has 3 replies, 2 voices, and was last updated 6 years, 9 months ago by Andrew Misplon.
- AuthorPosts
- January 5, 2018 at 5:14 pm #8536
bluereefParticipantHi Andrew,
I would like to increase the default image size on the attachment page.
Where can I do this?Thanks for your help.
Frank
January 5, 2018 at 5:48 pm #8538
Andrew MisplonKeymasterHi Frank
This snippet works for me: https://gist.github.com/rfmeier/5753101.
If you have a child theme you can insert that snippet minus the opening PHP tag into your child
functions.php
file. If not, go toPlugins > Add New
, search for and install Code Snippets. Then go toSnippets > Add New
, name the snippet as you’d like and insert the code from the Gist link above into the snippet body. Do not insert the opening PHP tag<?php
. Finally, opt to run the snippet on the site front-end only and then click Save changes and active. Note that it’s possible to only save a snippet so you must save and activate.Let me know how that goes 🙂
January 5, 2018 at 7:19 pm #8539
bluereefParticipantYes. That works. Thanks!
I was also able to do it by creating an attachment.php file in my child theme, copying the single.php code and modifying it by adding:
<?php echo wp_get_attachment_image( get_the_ID(), ‘large’ ); ?>
<?phpIs it ok to do it that way?
January 5, 2018 at 7:21 pm #8542
Andrew MisplonKeymaster100%. I wasn’t sure if you were using a child theme so I was going for easiest method. With a child theme it’s super easy to add an attachment.php file and take control that way. Nicely done and thanks for the update 🙂
- AuthorPosts
You must be logged in to reply to this topic.