Search
 
SCRIPT & CODE EXAMPLE
 

PHP

wordpress get post thumbnail url

<?php 
  // ALL parameters are optional. Not needed if you are on WP LOOP
  echo get_the_post_thumbnail_url( $the_query->ID, array( 500, 400) ); ?>
Comment

get featured image post wordpress by post id

<?php if (has_post_thumbnail( $post->ID ) ): ?>
  <?php $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'single-post-thumbnail' ); ?>
  <div id="custom-bg" style="background-image: url('<?php echo $image[0]; ?>')">

  </div>
<?php endif; ?>
Comment

wp get post thumbnail

$img_url = wp_get_attachment_image_url(get_post_thumbnail_id(get_the_ID()), 'full');
<img src="<?PHP echo $img_url?> ">
Comment

get post thumbnail wordpress dev

//Default WordPress
the_post_thumbnail( 'thumbnail' );     // Thumbnail (150 x 150 hard cropped)
the_post_thumbnail( 'medium' );        // Medium resolution (300 x 300 max height 300px)
the_post_thumbnail( 'medium_large' );  // Medium Large (added in WP 4.4) resolution (768 x 0 infinite height)
the_post_thumbnail( 'large' );         // Large resolution (1024 x 1024 max height 1024px)
the_post_thumbnail( 'full' );          // Full resolution (original size uploaded)
 
//With WooCommerce
the_post_thumbnail( 'shop_thumbnail' ); // Shop thumbnail (180 x 180 hard cropped)
the_post_thumbnail( 'shop_catalog' );   // Shop catalog (300 x 300 hard cropped)
the_post_thumbnail( 'shop_single' );    // Shop single (600 x 600 hard cropped)
Comment

wordpress get post featured image

//default 
$image_url = wp_get_attachment_url(1234);
// change if post have feature image
if (has_post_thumbnail($recent_post['ID'])) {
	$image_url = wp_get_attachment_url(get_post_thumbnail_id($recent_post['ID']), '');
}
Comment

PREVIOUS NEXT
Code Example
Php :: strpos in python 
Php :: laravel 5.4 forelse 
Php :: laravel artisan progress bar 
Php :: send email when form is submitted php 
Php :: laravel-admin Model does not exists ! 
Php :: get the charectors inside braces regex php 
Php :: laravel create migration view 
Php :: deleteAll cakephp 2 
Php :: write file in php 
Php :: laravel get query in normal sql without bindings 
Php :: cut out the beginning of the text in php 
Php :: laravel login by id 
Php :: php carbon convert string to date 
Php :: date 3 months ago for a particular date php 
Php :: php sessions 
Php :: generate token in php 
Php :: php check if string contains number 
Php :: asset not working in laravel 
Php :: php translate url wpml 
Php :: google fonts change font in echo php 
Php :: laravel wherehas 
Php :: specified key was too long max key length is 767 bytes 
Php :: migrate to an existing table in laravel commad 
Php :: WP Uploads Media Path 
Php :: acf get user form field 
Php :: laravel get last month records 
Php :: how to search in sentence laravel 
Php :: php parse url get path 
Php :: pdo get row count 
Php :: form validation with larvel api 
ADD CONTENT
Topic
Content
Source link
Name
8+9 =