$(function(){
	// Agregar un class numerado a cada post
	$('.post').addClass(function(){
		return 'post_'+$(this).index();
	})

	// Max posts
	$max = $('.post').index();

	for($i=0;$i<=$max;$i++) {
		$width = $('.post_'+$i+' img').width();
		$fix_width = parseInt($width)+12;

		$('.post_'+$i).css({
			'width': $fix_width,
		});

		if( $width < 400 ) {
			$('.post_'+$i).css({
				'margin-right': '8px',
			})
		}

		var html = $('.post_'+$i+' .entry-info').html();
		if(html) {
			html = html.replace('Visita el website','');
		}

		$('.post_'+$i+' .entry-info').html(html);
	}
	

	// Trasladar el contenido 1
	var info = $('.entry-content p:first').html();
	if (info) {
		info = info.replace('Visitar el website', '');
		$('.entry-content p:first').hide();
		$('.workinfo').html(info);
	}

	// Trasladar el contenido 2
	var url = $('.entry-content a:first').attr('href');
	if (url) {
		$('.entry-content a:first').hide();
		$('.link-visit').attr('href', url);
	} else {
		$('.link-visit').hide();
	}


})
