CodeHQ

Posts Tagged ‘URL’

|

Echo thumbnail URL and size | WordPress

Monday, October 24th, 2016

Use the PHP in the query below – and then the HTML example below to echo the URL out.

the_post_thumbnail_url();                  // without parameter -> 'post-thumbnail'
 
the_post_thumbnail_url( 'thumbnail' );       // Thumbnail (default 150px x 150px max)
the_post_thumbnail_url( 'medium' );          // Medium resolution (default 300px x 300px max)
the_post_thumbnail_url( 'large' );           // Large resolution (default 640px x 640px max)
the_post_thumbnail_url( 'full' );            // Full resolution (original size uploaded)
 
the_post_thumbnail_url( array(100, 100) );  // Other resolutions

Tags: , , , ,
Posted in PHP, WordPress | No Comments »

Adding a back to parent item link | WordPress

Thursday, July 30th, 2015

<?php
$this_page = get_post($id);
$parent_id = $this_page->post_parent;
if ($parent_id) {
	$parent = get_page($parent_id);
	echo '';
}
?>

Tags: , , ,
Posted in PHP, WordPress | No Comments »