Chị dậu tên thật là gì Featured snippet, Thumbnail, Sitelinks

I am using 3.4.1. I need to lớn display the featured image of a page. How can I get the featured image URL by particular page ID. Any help?



Did you try anything? Its always helpful to nội dung what you have tried.

Bạn đang xem: Chị dậu tên thật là gì Featured snippet, Thumbnail, Sitelinks

$url = wp_get_attachment_url( get_post_thumbnail_id($post_id) );Or if you want to lớn get the image by image form size.

Xem thêm: Nhà Công Vụ Là Gì - Cã¡N Bộ Cã´Ng ChứC Nã O đưÁ»£C Thuãª

$src = wp_get_attachment_image_src( get_post_thumbnail_id($post_id), "thumbnail_size" );$url = $src<0>;


As of 4.4.0, we can use get_the_post_thumbnail_url():

$url = get_the_post_thumbnail_url( $post_id, "thumbnail" );


Thanks for contributing an answer to lớn Development Staông xã Exchange!

Please be sure to lớn answer the question. Provide details and mô tả your research!

But avoid

Asking for help, clarification, or responding lớn other answers.Making statements based on opinion; baông xã them up with references or personal experience.

Xem thêm: Khu Đô Thị Tổng Cục 5 - Dự Án Tổng Cục 5 Tân Triều Hà Nội

To learn more, see our tips on writing great answers.

Post Your Answer Discard

By clicking “Post Your Answer”, you agree to lớn our terms of service, privacy policy và cookie policy

Not the answer you're looking for? Browse other questions tagged post-thumbnails or ask your own question.


site design / logo sản phẩm © 2021 Stack Exchange Inc; user contributions licensed under cc by-sa. rev2021.4.30.39183 is a trademark of the Foundation, registered in the US & other countries. This site is not affiliated with the Foundation in any way.

Your privacy

By clicking “Accept all cookies”, you agree Stachồng Exchange can store cookies on your device & discthua kém information in accordance with our Cookie Policy.

Chuyên mục: Blogs