Guest User

Untitled

a guest
Sep 25th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. <?php $args = array('post_type'=>array('filmes', 'series')); query_posts($args); if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
  2. <?php if (has_post_thumbnail()) {
  3. $imgsrc = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID),'home');
  4. $imgsrc = $imgsrc[0];
  5. } elseif ($postimages = get_children("post_parent=$post->ID&post_type=attachment&post_mime_type=image&numberposts=0")) {
  6. foreach($postimages as $postimage) {
  7. $imgsrc = wp_get_attachment_image_src($postimage->ID, 'home');
  8. $imgsrc = $imgsrc[0];
  9. }
  10. } elseif (preg_match('/
  11. <img [^>]*src=["|']([^"|']+)/i', get_the_content(), $match) != FALSE) {
  12. $imgsrc = $match[1];
  13. } else {
  14. $imgsrc = get_template_directory_uri() . '/images/no-imagen.png';
  15. } ?>
Add Comment
Please, Sign In to add comment