Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php get_header(); ?>
- <?php $pagename = $wp_query->post->post_title;
- if($pagename=='Indoberita.com - Indonesia dalam berita'){ ?>
- <ul class="unstyled" style="border-top: 1px solid #ccc;">
- <small>Advertisement</small><br/>
- <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
- <!-- seluler -->
- <ins class="adsbygoogle"
- style="display:inline-block;width:320px;height:100px"
- data-ad-client="ca-pub-5728085457413616"
- data-ad-slot="4922712729"></ins>
- <script>
- (adsbygoogle = window.adsbygoogle || []).push({});
- </script>
- <!-- LOOP START -->
- <?php
- $query = array( 'order' => 'DESC', 'paged' => $paged );
- $wp_query = new WP_Query($query);
- $i = 0;
- if ( have_posts() ) : while ( have_posts() ) : the_post(); $i++; ?>
- <li class="list">
- <?php
- $thumb = get_post_thumbnail_id();
- $img_url = wp_get_attachment_url( $thumb,'full'); //get img URL
- $image = aq_resize( $img_url, 50, 50, true ); //resize & crop img
- ?>
- <img class="pull-left" style="margin: 0 5px 0 0;" width="50" height="50" src="<?php echo $image ?>" />
- <h2 style="font-size: 15px; line-height: 16px; margin: 0px 0px 0px 0px;">
- <strong><a href="<?php the_permalink() ?>" title="Link to <?php the_title_attribute() ?>"><?php echo get_the_title(); ?>
- </strong></a></h2>
- <p style="margin-top: 5px;"><span style="font-size:10px;"><?php $cats = get_the_category($post->ID);
- 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>
- </li>
- <?php if($i == 4) : ?>
- <small>Advertisement</small><br/>
- <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
- <!-- seluler -->
- <ins class="adsbygoogle"
- style="display:inline-block;width:320px;height:100px"
- data-ad-client="ca-pub-5728085457413616"
- data-ad-slot="4922712729"></ins>
- <script>
- (adsbygoogle = window.adsbygoogle || []).push({});
- </script>
- <?php endif; ?>
- <?php if($i == 8) : ?>
- <small>Advertisement</small><br/>
- <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
- <!-- seluler -->
- <ins class="adsbygoogle"
- style="display:inline-block;width:320px;height:100px"
- data-ad-client="ca-pub-5728085457413616"
- data-ad-slot="4922712729"></ins>
- <script>
- (adsbygoogle = window.adsbygoogle || []).push({});
- </script>
- <?php endif; ?>
- <?php endwhile; ?>
- <center>
- <?php $slug='homepage';
- if($paged==0){ ?>
- <a class="btn btn-warning" href="<?php bloginfo('home'); ?>/<?=$slug;?>/page/<?=$paged+2;?>/">Next</a>
- <?php }elseif($paged==$wp_query->max_num_pages){ ?>
- <a class="btn btn-warning" href="<?php bloginfo('home'); ?>/<?=$slug;?>/page/<?=$paged-1;?>/">Prev</a>
- <?php }else{ ?>
- <a class="btn btn-warning" href="<?php bloginfo('home'); ?>/<?=$slug;?>/page/<?=$paged-1;?>/">Prev</a>
- <a class="btn btn-warning" href="<?php bloginfo('home'); ?>/<?=$slug;?>/page/<?=$paged+1;?>/">Next</a>
- <?php } ?>
- </center>
- <?php else: ?>
- <p><?php _e('Sorry, no posts published so far.'); ?></p>
- <?php endif; ?>
- </ul>
- <?php wp_reset_query(); ?>
- <?php }else{ ?>
- <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
- <h1 style="font-size: 18px; line-height: 19px; margin: 0px 0px 0px 5px;"><strong><?php the_title(); ?></strong></h1>
- <div class="content">
- <?php the_content(); ?>
- </div>
- <?php endwhile; endif; ?>
- <?php } ?>
- <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement