Community Forums › Forums › Archived Forums › Design Tips and Tricks › set image size on attachment page
Tagged: attachment pages, images, thumbnails
- This topic has 6 replies, 4 voices, and was last updated 12 years, 2 months ago by
rfmeier.
-
AuthorPosts
-
June 10, 2013 at 4:20 pm #45130
mmjaeger
MemberHello
I'd like to use a different image size on the attachment page - it looks like WP/Genesis is taking the medium image - how can I do that?Thanks
June 10, 2013 at 4:44 pm #45133rfmeier
MemberHello,
Good question. I had to dig around WordPress to find out exactly where this was being specified. You can adjust this with the WordPress '' filter. Hereis what I came up with;
I hope this helps.
December 16, 2013 at 4:23 pm #79566Cleo3
ParticipantThank you! I tried it and it works perfectly!
This problem has been driving me nuts for ages - finally took the time to search for an answer. I'm off to paste this into a bunch of sites! Thank you so much!
January 22, 2014 at 3:05 pm #86540Bart van Maanen
ParticipantThis looks like the fix I'm looking for. However, I pasted into the bottom of functions.php of the Minimum Pro theme and it disabled the whole file. Do I need to create a seperate attachment.php file to add to the Child Theme?
Or is it something with the //* -tags
I'm trying to use it in conjuction withe these styling options for the attachment pages:
//* Customize the post info function add_filter( 'genesis_post_info', 'sp_post_info_filter' ); function sp_post_info_filter($post_info) { if ( !is_attachment() ) { $post_info = '[post_date] by [post_author_posts_link] [post_comments] [post_edit]'; return $post_info; }} //* Customize the post meta function add_filter( 'genesis_post_meta', 'sp_post_meta_filter' ); function sp_post_meta_filter($post_meta) { if ( !is_attachment() ) { $post_meta = '[post_categories before="Filed Under: "] [post_tags before="Tagged: "]'; return $post_meta; }}January 22, 2014 at 5:44 pm #86559rfmeier
MemberJanuary 23, 2014 at 12:39 pm #86669Bart van Maanen
ParticipantI had to comment out the following, and then it worked;
add_filter( 'prepend_attachment', 'custom_prepend_attachment' ); // * Callback for WordPress 'prepend_attachment' filter. // * // * Change the attachment page image size to 'full' // * // * @package WordPress // * @category Attachment // * @see wp-includes/post-template.php // * // * @param string $attachment_content the attachment html // * @return string $attachment_content the attachment html function custom_prepend_attachment( $attachment_content ){ // set the attachment image size to 'full' $attachment_content = sprintf( '<p>%s</p>', wp_get_attachment_link(0, 'full', false) ); // return the attachment content return $attachment_content; }Is that okay?
Can I also add some code here to prevent the image to link any further. See: http://www.thomaselshuis.nl/wpsite/portfolio/travelogue/attachment/gr-twilight-horizon/Thanks!
January 23, 2014 at 4:12 pm #86701rfmeier
Member -
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.