CodeHQ

Posts Tagged ‘Image’

|

Using media gallery image sizes with ACF | WordPress

Friday, March 25th, 2016

You can use thumbnail, medium, large or full as the sizes variable to serve the size image you require.

<?php $image = get_field('the_image'); ?>
<img src="<?php echo $image['sizes']['thumbnail']; ?>" alt="<?php echo $image['caption']; ?>" />

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

Image alignment properties in WordPress

Tuesday, April 14th, 2015

Add this to your CSS to allow align left, right, center and none to images in WordPress posts and pages.

.alignright {
	float: right;
	padding: 10px 0px 10px 10px;
}
.alignleft {
	float: left;
	padding: 10px 10px 10px 0px;
}
.aligncenter {
	clear: both; 
	display: block; 
	margin-left: auto; 
	margin-right: auto;
	padding: 10px;
}
.alignnone {
	padding: 10px 0;
}

Tags: , , , , , ,
Posted in CSS | No Comments »