Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php $args = array('post_type'=>array('filmes', 'series')); query_posts($args); if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
- <?php if (has_post_thumbnail()) {
- $imgsrc = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID),'home');
- $imgsrc = $imgsrc[0];
- } elseif ($postimages = get_children("post_parent=$post->ID&post_type=attachment&post_mime_type=image&numberposts=0")) {
- foreach($postimages as $postimage) {
- $imgsrc = wp_get_attachment_image_src($postimage->ID, 'home');
- $imgsrc = $imgsrc[0];
- }
- } elseif (preg_match('/
- <img [^>]*src=["|']([^"|']+)/i', get_the_content(), $match) != FALSE) {
- $imgsrc = $match[1];
- } else {
- $imgsrc = get_template_directory_uri() . '/images/no-imagen.png';
- } ?>
Add Comment
Please, Sign In to add comment