wordpress resimli haber detay sayfası


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  1. <?php
  2. get_header();
  3. get_sidebar();
  4. ?>
  5.  
  6. <!-- MAIN -->
  7. <div id="main">
  8. <h3><?php the_title(); ?></h3>
  9.  
  10. <div class="pageContent single">
  11. <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
  12.  
  13. <?php
  14. $yanHaberResim = get_children(array(
  15. 'post_parent' => get_the_ID(),
  16. 'post_type' => 'attachment',
  17. 'numberposts' => 1,
  18. 'order' => 'DESC',
  19. 'orderby' => 'date',
  20. 'post_mime_type' => 'image'));
  21.  
  22. foreach( $yanHaberResim as $listele ) {
  23. $img=wp_get_attachment_image_src($listele->ID, 'sideSlider');
  24. $cap=$listele->post_title;
  25. }
  26. ?>
  27. <img class="singleThumb" src="<?php echo $img[0]; ?>" alt="<?php echo $cap; ?>">
  28. <?php the_content(); ?>
  29. <?php endwhile; ?>
  30. <?php endif; ?>
  31. </div>
  32. <?php get_footer(); ?>

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.