Return to Snippet

Revision: 24418
at March 4, 2010 05:30 by ignacio


Updated Code
<!-- el CSS que se tendría que añadir a style.css al final de todo (un ejemplo, se puede hacer con px) -->

.columna{
	width:30%;
	float:left;
	margin-right:3%
	}

.columna h5 a{
	color:#D90819
	}
	
<!-- el HTML y PHP en index.php, etc-->

<div class="columna">

	<?php
	    $category_id = get_cat_ID( 'Categorí­a 1' );
	    $category_link = get_category_link( $category_id );
	?>
	<h5><a href="<?php echo $category_link; ?>" title="Categorí­a 1">Categorí­a 1</a></h5>

	<?php
	$posts = get_posts('category_name=noticias&numberposts=3');
	foreach($posts as $post):
	setup_postdata($post);
	?>

	<h3><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3>
	<?php the_excerpt(); ?>

	<?php $posttags = get_the_tags($post->ID); if ($posttags) {
	foreach($posttags as $tag) {
	echo '<a href="';
	echo get_tag_link($tag);
	echo '">';
	echo $tag->name . ' ';
	echo '</a>';
	}
	}
	?>
	<?php endforeach; ?>

</div>

<div class="columna">

	<?php
	    $category_id = get_cat_ID( 'Categorí­a 2' );
	    $category_link = get_category_link( $category_id );
	?>
	<h5><a href="<?php echo $category_link; ?>" title="Categorí­a 2">Categorí­a 2</a></h5>

	<?php
	$posts = get_posts('category_name=cine&numberposts=3');
	foreach($posts as $post):
	setup_postdata($post);
	?>

	<h3><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3>
	<?php the_excerpt(); ?>

	<?php $posttags = get_the_tags($post->ID); if ($posttags) {
	foreach($posttags as $tag) {
	echo '<a href="';
	echo get_tag_link($tag);
	echo '">';
	echo $tag->name . ' ';
	echo '</a>';
	}
	}
	?>
	<?php endforeach; ?>

</div>

<div class="columna">

	<?php
	    $category_id = get_cat_ID( 'Categorí­a 3' );
	    $category_link = get_category_link( $category_id );
	?>
	<h5><a href="<?php echo $category_link; ?>" title="Categorí­a 3">Categorí­a 3</a></h5>

	<?php
	$posts = get_posts('category_name=musica&numberposts=3');
	foreach($posts as $post):
	setup_postdata($post);
	?>

	<h3><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3>
	<?php the_excerpt(); ?>

	<?php $posttags = get_the_tags($post->ID); if ($posttags) {
	foreach($posttags as $tag) {
	echo '<a href="';
	echo get_tag_link($tag);
	echo '">';
	echo $tag->name . ' ';
	echo '</a>';
	}
	}
	?>
	<?php endforeach; ?>

</div>

Revision: 24417
at March 4, 2010 05:21 by ignacio


Updated Code
<!-- el CSS que se tendría que añadir a style.css al final de todo (un ejemplo, se puede hacer con px) -->

.columna{
	width:30%;
	float:left;
	margin-right:3%
	}

.columna h5 a{
	color:#D90819
	}
	
<!-- el HTML y PHP en index.php, etc-->

<div class="columna">

	<?php
	    $category_id = get_cat_ID( 'Categoría 1' );
	    $category_link = get_category_link( $category_id );
	?>
	<h5><a href="<?php echo $category_link; ?>" title="Categoría 1">Categoría 1</a></h5>

	<?php
	$posts = get_posts('category_name=noticias&numberposts=3');
	foreach($posts as $post):
	setup_postdata($post);
	?>

	<h3><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3>
	<?php the_excerpt(); ?>

	<?php $posttags = get_the_tags($post->ID); if ($posttags) {
	foreach($posttags as $tag) {
	echo '<a href="';
	echo get_tag_link($tag);
	echo '">';
	echo $tag->name . ' ';
	echo '</a>';
	}
	}
	?>
	<?php endforeach; ?>

</div>

<div class="columna">

	<?php
	    $category_id = get_cat_ID( 'Categoría 2' );
	    $category_link = get_category_link( $category_id );
	?>
	<h5><a href="<?php echo $category_link; ?>" title="Categoría 2">Categoría 2</a></h5>

	<?php
	$posts = get_posts('category_name=cine&numberposts=3');
	foreach($posts as $post):
	setup_postdata($post);
	?>

	<h3><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3>
	<?php the_excerpt(); ?>

	<?php $posttags = get_the_tags($post->ID); if ($posttags) {
	foreach($posttags as $tag) {
	echo '<a href="';
	echo get_tag_link($tag);
	echo '">';
	echo $tag->name . ' ';
	echo '</a>';
	}
	}
	?>
	<?php endforeach; ?>

</div>

<div class="columna">

	<?php
	    $category_id = get_cat_ID( 'Categoría 3' );
	    $category_link = get_category_link( $category_id );
	?>
	<h5><a href="<?php echo $category_link; ?>" title="Categoría 3">Categoría 3</a></h5>

	<?php
	$posts = get_posts('category_name=musica&numberposts=3');
	foreach($posts as $post):
	setup_postdata($post);
	?>

	<h3><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3>
	<?php the_excerpt(); ?>

	<?php $posttags = get_the_tags($post->ID); if ($posttags) {
	foreach($posttags as $tag) {
	echo '<a href="';
	echo get_tag_link($tag);
	echo '">';
	echo $tag->name . ' ';
	echo '</a>';
	}
	}
	?>
	<?php endforeach; ?>

</div>

Revision: 24416
at March 4, 2010 05:14 by ignacio


Updated Code
<!-- el CSS que se tendrí­a que añadir a style.css al final de todo (un ejemplo, se puede hacer con px) -->

.columna{
	width:30%;
	float:left;
	margin-right:3%
	}

.columna h5{
	color:#D90819
	}
	
<!-- el HTML y PHP en index.php, etc-->

<div class="columna">

	<?php
	    $category_id = get_cat_ID( 'Categoría 1' );
	    $category_link = get_category_link( $category_id );
	?>
	<h5><a href="<?php echo $category_link; ?>" title="Categoría 1">Categoría 1</a></h5>

	<?php
	$posts = get_posts('category_name=noticias&numberposts=3');
	foreach($posts as $post):
	setup_postdata($post);
	?>

	<h3><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3>
	<?php the_excerpt(); ?>

	<?php $posttags = get_the_tags($post->ID); if ($posttags) {
	foreach($posttags as $tag) {
	echo '<a href="';
	echo get_tag_link($tag);
	echo '">';
	echo $tag->name . ' ';
	echo '</a>';
	}
	}
	?>
	<?php endforeach; ?>

</div>

<div class="columna">

	<?php
	    $category_id = get_cat_ID( 'Categoría 2' );
	    $category_link = get_category_link( $category_id );
	?>
	<h5><a href="<?php echo $category_link; ?>" title="Categoría 2">Categoría 2</a></h5>

	<?php
	$posts = get_posts('category_name=cine&numberposts=3');
	foreach($posts as $post):
	setup_postdata($post);
	?>

	<h3><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3>
	<?php the_excerpt(); ?>

	<?php $posttags = get_the_tags($post->ID); if ($posttags) {
	foreach($posttags as $tag) {
	echo '<a href="';
	echo get_tag_link($tag);
	echo '">';
	echo $tag->name . ' ';
	echo '</a>';
	}
	}
	?>
	<?php endforeach; ?>

</div>

<div class="columna">

	<?php
	    $category_id = get_cat_ID( 'Categoría 3' );
	    $category_link = get_category_link( $category_id );
	?>
	<h5><a href="<?php echo $category_link; ?>" title="Categoría 3">Categoría 3</a></h5>

	<?php
	$posts = get_posts('category_name=musica&numberposts=3');
	foreach($posts as $post):
	setup_postdata($post);
	?>

	<h3><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3>
	<?php the_excerpt(); ?>

	<?php $posttags = get_the_tags($post->ID); if ($posttags) {
	foreach($posttags as $tag) {
	echo '<a href="';
	echo get_tag_link($tag);
	echo '">';
	echo $tag->name . ' ';
	echo '</a>';
	}
	}
	?>
	<?php endforeach; ?>

</div>

Revision: 24415
at March 4, 2010 05:13 by ignacio


Updated Code
<!-- el CSS que se tendrí­a que añadir a style.css al final de todo (un ejemplo, se puede hacer con px) -->

.columna{
	width:30%;
	float:left;
	margin-right:3%
	}
	
<!-- el HTML y PHP en index.php, etc-->

<div class="columna">

	<?php
	    $category_id = get_cat_ID( 'Categoría 1' );
	    $category_link = get_category_link( $category_id );
	?>
	<h5><a href="<?php echo $category_link; ?>" title="Categoría 1">Categoría 1</a></h5>

	<?php
	$posts = get_posts('category_name=noticias&numberposts=3');
	foreach($posts as $post):
	setup_postdata($post);
	?>

	<h3><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3>
	<?php the_excerpt(); ?>

	<?php $posttags = get_the_tags($post->ID); if ($posttags) {
	foreach($posttags as $tag) {
	echo '<a href="';
	echo get_tag_link($tag);
	echo '">';
	echo $tag->name . ' ';
	echo '</a>';
	}
	}
	?>
	<?php endforeach; ?>

</div>

<div class="columna">

	<?php
	    $category_id = get_cat_ID( 'Categoría 2' );
	    $category_link = get_category_link( $category_id );
	?>
	<h5><a href="<?php echo $category_link; ?>" title="Categoría 2">Categoría 2</a></h5>

	<?php
	$posts = get_posts('category_name=cine&numberposts=3');
	foreach($posts as $post):
	setup_postdata($post);
	?>

	<h3><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3>
	<?php the_excerpt(); ?>

	<?php $posttags = get_the_tags($post->ID); if ($posttags) {
	foreach($posttags as $tag) {
	echo '<a href="';
	echo get_tag_link($tag);
	echo '">';
	echo $tag->name . ' ';
	echo '</a>';
	}
	}
	?>
	<?php endforeach; ?>

</div>

<div class="columna">

	<?php
	    $category_id = get_cat_ID( 'Categoría 3' );
	    $category_link = get_category_link( $category_id );
	?>
	<h5><a href="<?php echo $category_link; ?>" title="Categoría 3">Categoría 3</a></h5>

	<?php
	$posts = get_posts('category_name=musica&numberposts=3');
	foreach($posts as $post):
	setup_postdata($post);
	?>

	<h3><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3>
	<?php the_excerpt(); ?>

	<?php $posttags = get_the_tags($post->ID); if ($posttags) {
	foreach($posttags as $tag) {
	echo '<a href="';
	echo get_tag_link($tag);
	echo '">';
	echo $tag->name . ' ';
	echo '</a>';
	}
	}
	?>
	<?php endforeach; ?>

</div>

Revision: 24414
at March 2, 2010 13:18 by ignacio


Updated Code
<!-- el CSS que se tendría que añadir a style.css al final de todo (un ejemplo, se puede hacer con px) -->

.columna{
	width:30%;
	float:left;
	margin-right:3%
	}
	
<!-- el HTML y PHP en index.php, etc-->

<div class="columna">

	<?php
	$posts = get_posts('category_name=noticias&numberposts=3');
	foreach($posts as $post):
	setup_postdata($post);
	?>

	<h5><?php the_category(); ?></h5>
	<h3><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3>
	<?php the_excerpt(); ?>

	<?php $posttags = get_the_tags($post->ID); if ($posttags) {
	foreach($posttags as $tag) {
	echo '<a href="';
	echo get_tag_link($tag);
	echo '">';
	echo $tag->name . ' ';
	echo '</a>';
	}
	}
	?>
	<?php endforeach; ?>

</div>

<div class="columna">

	<?php
	$posts = get_posts('category_name=cine&numberposts=3');
	foreach($posts as $post):
	setup_postdata($post);
	?>

	<h5><?php the_category(); ?></h5>
	<h3><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3>
	<?php the_excerpt(); ?>

	<?php $posttags = get_the_tags($post->ID); if ($posttags) {
	foreach($posttags as $tag) {
	echo '<a href="';
	echo get_tag_link($tag);
	echo '">';
	echo $tag->name . ' ';
	echo '</a>';
	}
	}
	?>
	<?php endforeach; ?>

</div>

<div class="columna">

	<?php
	$posts = get_posts('category_name=musica&numberposts=3');
	foreach($posts as $post):
	setup_postdata($post);
	?>

	<h5><?php the_category(); ?></h5>
	<h3><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3>
	<?php the_excerpt(); ?>

	<?php $posttags = get_the_tags($post->ID); if ($posttags) {
	foreach($posttags as $tag) {
	echo '<a href="';
	echo get_tag_link($tag);
	echo '">';
	echo $tag->name . ' ';
	echo '</a>';
	}
	}
	?>
	<?php endforeach; ?>

</div>

Revision: 24413
at March 1, 2010 14:39 by ignacio


Updated Code
<!-- el CSS que se tendrí­a que añadir a style.css al final de todo (un ejemplo, se puede hacer con px) -->

.columna{
	width:30%;
	float:left;
	margin-right:3%
	}
	
<!-- el HTML y PHP en index.php, etc-->

<div class="columna">

	<?php
	$posts = get_posts('category_name=noticias&numberposts=3');
	foreach($posts as $post):
	setup_postdata($post);
	?>

	<h5><?php the_category(); ?></h5>
	<h3><?php the_title(); ?></h3>
	<?php the_excerpt(); ?>

	<?php $posttags = get_the_tags($post->ID); if ($posttags) {
	foreach($posttags as $tag) {
	echo '<a href="';
	echo get_tag_link($tag);
	echo '">';
	echo $tag->name . ' ';
	echo '</a>';
	}
	}
	?>
	<?php endforeach; ?>

</div>

<div class="columna">

	<?php
	$posts = get_posts('category_name=cine&numberposts=3');
	foreach($posts as $post):
	setup_postdata($post);
	?>

	<h5><?php the_category(); ?></h5>
	<h3><?php the_title(); ?></h3>
	<?php the_excerpt(); ?>

	<?php $posttags = get_the_tags($post->ID); if ($posttags) {
	foreach($posttags as $tag) {
	echo '<a href="';
	echo get_tag_link($tag);
	echo '">';
	echo $tag->name . ' ';
	echo '</a>';
	}
	}
	?>
	<?php endforeach; ?>

</div>

<div class="columna">

	<?php
	$posts = get_posts('category_name=musica&numberposts=3');
	foreach($posts as $post):
	setup_postdata($post);
	?>

	<h5><?php the_category(); ?></h5>
	<h3><?php the_title(); ?></h3>
	<?php the_excerpt(); ?>

	<?php $posttags = get_the_tags($post->ID); if ($posttags) {
	foreach($posttags as $tag) {
	echo '<a href="';
	echo get_tag_link($tag);
	echo '">';
	echo $tag->name . ' ';
	echo '</a>';
	}
	}
	?>
	<?php endforeach; ?>

</div>

Revision: 24412
at March 1, 2010 14:38 by ignacio


Updated Code
<!-- el CSS que se tendría que añadir a style.css al final de todo (un ejemplo, se puede hacer con px) -->

.columna{
	width:30%;
	float:left;
	margin-right:3%
	}
	
<!-- el HTML y PHP en index.php, etc-->

<div class="columna">

	<?php
	$posts = get_posts('category_name=noticias&numberposts=3');
	foreach($posts as $post):
	setup_postdata($post);
	?>

	<h5><?php the_category(); ?></h5>
	<h3><?php the_title(); ?></h3>
	<?php the_excerpt(); ?>

	<?php $posttags = get_the_tags($post->ID); if ($posttags) {
	foreach($posttags as $tag) {
	echo '<a href="';
	echo get_tag_link($tag);
	echo '">';
	echo $tag->name . ' ';
	echo '</a>';
	}
	}
	?>
	<?php endforeach; ?>

</div>

<div class="columna">

	<?php
	$posts = get_posts('category_name=cine&numberposts=3');
	foreach($posts as $post):
	setup_postdata($post);
	?>

	<h5><?php the_category(); ?></h5>
	<h3><?php the_title(); ?></h3>
	<?php the_excerpt(); ?>

	<?php $posttags = get_the_tags($post->ID); if ($posttags) {
	foreach($posttags as $tag) {
	echo '<a href="';
	echo get_tag_link($tag);
	echo '">';
	echo $tag->name . ' ';
	echo '</a>';
	}
	}
	?>
	<?php endforeach; ?>

</div>

<div class="columna">

	<?php
	$posts = get_posts('category_name=musica&numberposts=3');
	foreach($posts as $post):
	setup_postdata($post);
	?>

	<h5><?php the_category(); ?></h5>
	<h3><?php the_title(); ?></h3>
	<?php the_excerpt(); ?>

	<?php $posttags = get_the_tags($post->ID); if ($posttags) {
	foreach($posttags as $tag) {
	echo '<a href="';
	echo get_tag_link($tag);
	echo '">';
	echo $tag->name . ' ';
	echo '</a>';
	}
	}
	?>
	<?php endforeach; ?>

</div>

Revision: 24411
at March 1, 2010 14:28 by ignacio


Initial Code
<!-- el CSS que se tendría que añadir a style.css (un ejemplo, se puede hacer con px) -->

.columna{
	width:30%;
	float:left;
	margin-right:3%
	}
	
<!-- el HTML y PHP en index.php, etc-->

<div class="columna">

	<?php
	$posts = get_posts('category_name=noticias&numberposts=3');
	foreach($posts as $post):
	setup_postdata($post);
	?>

	<h5><?php the_category(); ?></h5>
	<h3><?php the_title(); ?></h3>
	<?php the_excerpt(); ?>

	<?php $posttags = get_the_tags($post->ID); if ($posttags) {
	foreach($posttags as $tag) {
	echo '<a href="';
	echo get_tag_link($tag);
	echo '">';
	echo $tag->name . ' ';
	echo '</a>';
	}
	}
	?>
	<?php endforeach; ?>

</div>

<div class="columna">

	<?php
	$posts = get_posts('category_name=cine&numberposts=3');
	foreach($posts as $post):
	setup_postdata($post);
	?>

	<h5><?php the_category(); ?></h5>
	<h3><?php the_title(); ?></h3>
	<?php the_excerpt(); ?>

	<?php $posttags = get_the_tags($post->ID); if ($posttags) {
	foreach($posttags as $tag) {
	echo '<a href="';
	echo get_tag_link($tag);
	echo '">';
	echo $tag->name . ' ';
	echo '</a>';
	}
	}
	?>
	<?php endforeach; ?>

</div>

<div class="columna">

	<?php
	$posts = get_posts('category_name=musica&numberposts=3');
	foreach($posts as $post):
	setup_postdata($post);
	?>

	<h5><?php the_category(); ?></h5>
	<h3><?php the_title(); ?></h3>
	<?php the_excerpt(); ?>

	<?php $posttags = get_the_tags($post->ID); if ($posttags) {
	foreach($posttags as $tag) {
	echo '<a href="';
	echo get_tag_link($tag);
	echo '">';
	echo $tag->name . ' ';
	echo '</a>';
	}
	}
	?>
	<?php endforeach; ?>

</div>

Initial URL


Initial Description


Initial Title
HTML / CSS creando varios loops en varias columnas

Initial Tags
wordpress

Initial Language
PHP