Home › Forums › Support › Show Featured Image Resolution under sidebar and size with GP Hooks This topic has 5 replies, 2 voices, and was last updated 7 years ago by Tom. Viewing 6 posts - 1 through 6 (of 6 total) Author Posts September 11, 2017 at 11:14 pm #383632 Ralfs How to show Featured images Size and resolution under sidebar with GP hooks? What PHP function I have to use? September 11, 2017 at 11:36 pm #383645 TomLead Developer Lead Developer I’m not too sure what you mean – any examples? September 12, 2017 at 1:26 am #383698 Ralfs For example here – https://puu.sh/xxM4V/2ceeb0c32e.png I want to display info about Featured image. I want to use GP Hooks, so I can display the info before sidebar on single post September 12, 2017 at 2:15 pm #384217 TomLead Developer Lead Developer That would involve some pretty heavy coding. I think you would use this function: https://developer.wordpress.org/reference/functions/wp_get_attachment_image_src/ Check out the examples at the bottom on how to get the height and width etc.. September 12, 2017 at 10:13 pm #384369 Ralfs Hi, I did manage to figure it out myself: I added this to GP hook: <?php if ( has_post_thumbnail() ) { $large_image_url = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'full' ); echo 'Resolution: '.$large_image_url[1].'x'.$large_image_url[2]; } ?> But I need to know, is this good solution? Actually resolving issues is a lot of fun π Myb I should learn wp development myself. π September 12, 2017 at 11:41 pm #384398 TomLead Developer Lead Developer That’s perfect π Author Posts Viewing 6 posts - 1 through 6 (of 6 total) You must be logged in to reply to this topic. Log In Username: Password: Keep me signed in Log In