Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $las_ofertas = new WP_Query(array(
- 'post_type' => 'oferta',
- 'posts_per_page' => 5
- ));
- $ciudad = get_post_meta($post->ID, 'oferta_ciudad', true);
- $fecha = get_post_meta($post->ID, 'oferta_date', true);
- $descripcion = get_post_meta($post->ID, 'oferta_descripcion', true);
- if ( $las_ofertas->have_posts() ) {
- while ( $las_ofertas->have_posts() ) : $las_ofertas->the_post(); ?>
- <article class="al70">
- <h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
- <?php if( $ciudad ) { ?> <p><?php echo ($ciudad); ?></p>
- <?php } else {?> <p>La oferta no especifica la ciudad en la que desarrollará el trabajo.</p> <?php } ?>
- <?php if( $fecha ) { ?> <p><?php echo ($fecha); ?></p>
- <?php } else {?> <p>La oferta no especifica la fecha de inicio.</p> <?php } ?>
- <?php if( $descripcion ) { ?>
- <h3>Descripción:</h3>
- <p><?php echo ($descripcion); ?></p>
- <?php } else {?> <p>La empresa no ofrece detalles del trabajo.</p> <?php } ?>
- <p><a href="<?php the_permalink(); ?>" class="btn"><?php _e('Ver oferta...') ?></a></p>
- </article> <!-- article -->
- <?php endwhile;
- } else { ?>
- <p>No existen ofertas para mostrar.</p>
- <?php } ?>
- <?php wp_reset_postdata();
Add Comment
Please, Sign In to add comment