Advertisement
Guest User

tes

a guest
Nov 28th, 2014
208
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.45 KB | None | 0 0
  1. <?php get_header(); ?>
  2. <?php $pagename = $wp_query->post->post_title;
  3. if($pagename=='Indoberita.com - Indonesia dalam berita'){ ?>
  4. <ul class="unstyled" style="border-top: 1px solid #ccc;">
  5. <small>Advertisement</small><br/>
  6. <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
  7. <!-- seluler -->
  8. <ins class="adsbygoogle"
  9. style="display:inline-block;width:320px;height:100px"
  10. data-ad-client="ca-pub-5728085457413616"
  11. data-ad-slot="4922712729"></ins>
  12. <script>
  13. (adsbygoogle = window.adsbygoogle || []).push({});
  14. </script>
  15. <!-- LOOP START -->
  16. <?php
  17. $query = array( 'order' => 'DESC', 'paged' => $paged );
  18. $wp_query = new WP_Query($query);
  19. $i = 0;
  20. if ( have_posts() ) : while ( have_posts() ) : the_post(); $i++; ?>
  21. <li class="list">
  22. <?php
  23. $thumb = get_post_thumbnail_id();
  24. $img_url = wp_get_attachment_url( $thumb,'full'); //get img URL
  25. $image = aq_resize( $img_url, 50, 50, true ); //resize & crop img
  26. ?>
  27. <img class="pull-left" style="margin: 0 5px 0 0;" width="50" height="50" src="<?php echo $image ?>" />
  28. <h2 style="font-size: 15px; line-height: 16px; margin: 0px 0px 0px 0px;">
  29. <strong><a href="<?php the_permalink() ?>" title="Link to <?php the_title_attribute() ?>"><?php echo get_the_title(); ?>
  30. </strong></a></h2>
  31. <p style="margin-top: 5px;"><span style="font-size:10px;"><?php $cats = get_the_category($post->ID);
  32. echo '<a class="text-error" href="'.get_category_link($cats[0]->cat_ID).'">'.$cats[0]->cat_name.'</a>';?> - <?php the_time( 'd-m-Y G:i' ) ?> </span> </p>
  33. </li>
  34. <?php if($i == 4) : ?>
  35. <small>Advertisement</small><br/>
  36. <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
  37. <!-- seluler -->
  38. <ins class="adsbygoogle"
  39. style="display:inline-block;width:320px;height:100px"
  40. data-ad-client="ca-pub-5728085457413616"
  41. data-ad-slot="4922712729"></ins>
  42. <script>
  43. (adsbygoogle = window.adsbygoogle || []).push({});
  44. </script>
  45. <?php endif; ?>
  46. <?php if($i == 8) : ?>
  47. <small>Advertisement</small><br/>
  48. <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
  49. <!-- seluler -->
  50. <ins class="adsbygoogle"
  51. style="display:inline-block;width:320px;height:100px"
  52. data-ad-client="ca-pub-5728085457413616"
  53. data-ad-slot="4922712729"></ins>
  54. <script>
  55. (adsbygoogle = window.adsbygoogle || []).push({});
  56. </script>
  57. <?php endif; ?>
  58. <?php endwhile; ?>
  59. <center>
  60. <?php $slug='homepage';
  61. if($paged==0){ ?>
  62. <a class="btn btn-warning" href="<?php bloginfo('home'); ?>/<?=$slug;?>/page/<?=$paged+2;?>/">Next</a>
  63. <?php }elseif($paged==$wp_query->max_num_pages){ ?>
  64. <a class="btn btn-warning" href="<?php bloginfo('home'); ?>/<?=$slug;?>/page/<?=$paged-1;?>/">Prev</a>
  65. <?php }else{ ?>
  66. <a class="btn btn-warning" href="<?php bloginfo('home'); ?>/<?=$slug;?>/page/<?=$paged-1;?>/">Prev</a>
  67. <a class="btn btn-warning" href="<?php bloginfo('home'); ?>/<?=$slug;?>/page/<?=$paged+1;?>/">Next</a>
  68. <?php } ?>
  69. </center>
  70. <?php else: ?>
  71. <p><?php _e('Sorry, no posts published so far.'); ?></p>
  72. <?php endif; ?>
  73. </ul>
  74. <?php wp_reset_query(); ?>
  75. <?php }else{ ?>
  76. <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
  77. <h1 style="font-size: 18px; line-height: 19px; margin: 0px 0px 0px 5px;"><strong><?php the_title(); ?></strong></h1>
  78. <div class="content">
  79. <?php the_content(); ?>
  80. </div>
  81. <?php endwhile; endif; ?>
  82. <?php } ?>
  83. <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement