CodeHQ

Archive for October, 2015

|

Full-screen and centralised responsive video | CSS

Thursday, October 29th, 2015

.video {
	position: absolute;
	top: 50%; 
	left: 50%;
	z-index: 1;
	min-width: 100%;
	min-height: 100%;
	width: auto;
	height: auto;
	transform: translate(-50%, -50%);
}

EDIT: Another method I found and am trying is this CSS based responsive video that keeps the 16/9 ratio.

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

Allow Google analytics on private page | PHP

Tuesday, October 13th, 2015

<?php $allow_inside = ($is_logged_in) || substr_count($_SERVER['HTTP_USER_AGENT'],'Googlebot'); ?>

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

Query custom post type based on custom field | WordPress

Monday, October 5th, 2015

<?php 
$cityname = get_field('city_name');

$args = array(
	'posts_per_page' => '100',
	'post_type' 	 => 'neighborhood',
	'meta_key'	 => 'city_n',
	'meta_value'	 => $cityname,
	'order'	         => 'asc'
);

$cityquery = new WP_Query($args);
$i = 1;
while ( $cityquery->have_posts() ) : $cityquery-> the_post();?>

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