Extra Posts On Travelous Theme

Hi again! After take a break of blogging for several weeks, a ton of e-mails already waiting to be answered. This time most of them asking about this great theme, Travelous by ColorLabs & Company.

For me, this theme is great with the map tagging feature. But, this time that feature is not my concern, but to modify this theme become like this one:

Great blog! Maybe you have to check this blog first before start travelling

Great blog! Maybe you have to check this blog first before start travelling

If you check this blog, they have an extra blog posts displayed. What a great idea to make your Travelous theme become like this one.

Let me tell you, in order to modify this theme become asiaplacestosee.com, you just have to edit only 1 file, it is index.php

Ok then, if you open the file you will find this codes:

<?php get_header(); global $colabs_options; ?>
	<?php
		$slider=get_option('colabs_slider');
		if ($slider=='')$slider=1;
		$query_reviews = new WP_query( array(
				'showposts' => 5,
				'post_type' => 'review',
				'tax_query' => array(
									array(
									'taxonomy' => 'review_category',
									'field' => 'id',
									'terms' => $slider
									)
								)
		));
		if($query_reviews->have_posts()):
	?>
	<div class="flex-container column col12">
		<div class="flexslider">
			<ul class="slides">
			<?php while ($query_reviews->have_posts() ) : $query_reviews->the_post();?>
				<li>
					<?php colabs_image('width=950&height=386&play=true');?>
					<div class="flex-caption">
                    <em><a href="<?php the_permalink();?>"><?php the_title();?></a></em><br/>
                    <?php colabs_custom_excerpt();?>
					<?php the_tags('// ', ', ', '');?>
                    </div>
				</li>
			<?php endwhile;?>
			</ul>
		</div><!-- .flexslider -->
	</div><!-- .flex-container -->
	<div class="separator"></div>
	<?php endif;?>

	<?php
		$limit=get_option('colabs_latest_limit');
		$exclude=get_option('colabs_latest_exclude');
		if ($limit=='')$limit=8;
		$query_posts = new WP_query( array(
				'showposts' => $limit,
				'post_type' => 'post',
				'category__not_in' => $exclude
		));
		if($query_posts->have_posts()):
	?>
	<div class="main columns col11">
		<div class="stories columns col11">
        	<h2><?php _e('Latest Stories','colabsthemes');?></h2>
        	<ul>
            	<?php while ( $query_posts->have_posts() ) : $query_posts->the_post();?>
				<li class="columns col3">
                <a href="<?php the_permalink();?>" title="">
                    <h2><?php the_title();?></h2>
                	<?php colabs_image('width=238&height=158&play=true');?>
                    <?php colabs_custom_excerpt();?>
                </a>
                </li>
            	<?php endwhile;?>
            </ul>
        </div>
		<?php endif;?>

		<?php
		$latestreviews=get_option('colabs_latest_review');
		$count=count($latestreviews);
		$i=1;
		?>
        <div class="reviews column col7">
        <h2><?php _e('Latest Reviews','colabsthemes');?> <span class="section"><?php _e('on','colabsthemes');?>
		<?php if(!empty($latestreviews)):foreach ($latestreviews as $latestreview):
		$term = get_term( $latestreview, 'review_category' );
		?>
		<a href="#<?php echo $term->term_id;?>" title="<?php echo $term->name;?>">
		<?php echo $term->name;
		if ($i<$count) echo ' / ';?>
		</a>
		<?php $i++; endforeach;endif;?>
		</h2>
		<div>
        <?php
		if(!empty($latestreviews)):
		foreach ($latestreviews as $latestreview):
		$term = get_term( $latestreview, 'review_category' );
		$query_posts = new WP_query( array(
				'showposts' => 4,
				'post_type' => 'review',
				'tax_query' => array(
									array(
									'taxonomy' => 'review_category',
									'field' => 'id',
									'terms' => $term->term_id
									)
								)
		));
		if( $query_posts->have_posts()):
		?>

		<ul id="<?php echo $term->term_id;?>">
			<?php while ( $query_posts->have_posts() ) : $query_posts->the_post();?>
            <li class="column">
            	<a href="<?php the_permalink();?>" title=""><?php colabs_image('width=100&height=150');?></a>
            	<h3><?php the_title();?></h3>
            	<div class="rate" data="<?php echo get_rating($post->ID); ?>"></div>
			</li>
			<?php endwhile;?>
        </ul>
		<?php endif;endforeach;endif;?>
		</div>
        </div>

        <div class="map column col4">
	        <h2><?php _e('My Journey on Map','colabsthemes');?></h2>
	        <div id="googlemap" style="height:200px"></div>
	        <?php echo setMap(array( 'el' => 'googlemap' )); ?>
			<?php $enlarge=get_option('colabs_enlarge');
			if ($enlarge){
			?>
			<a href="<?php echo get_permalink($enlarge);?>" class="enlarge-button"><?php _e('Enlarge','colabsthemes');?></a>
			<?php }?>
        </div>

	</div><!-- .main -->

<?php get_footer(); ?>

Edit that code become:

<?php get_header(); global $colabs_options; ?>
	<?php
		$slider=get_option('colabs_slider');
		if ($slider=='')$slider=1;
		$query_reviews = new WP_query( array(
				'showposts' => 5,
				'post_type' => 'review',
				'tax_query' => array(
									array(
									'taxonomy' => 'review_category',
									'field' => 'id',
									'terms' => $slider
									)
								)
		));
		if($query_reviews->have_posts()):
	?>
	<div class="flex-container column col12">
		<div class="flexslider">
			<ul class="slides">
			<?php while ($query_reviews->have_posts() ) : $query_reviews->the_post();?>
				<li>
					<?php colabs_image('width=950&height=386&play=true');?>
					<div class="flex-caption">
                    <em><a href="<?php the_permalink();?>"><?php the_title();?></a></em><br/>
                    <?php colabs_custom_excerpt();?>
					<?php the_tags('// ', ', ', '');?>
                    </div>
				</li>
			<?php endwhile;?>
			</ul>
		</div><!-- .flexslider -->
	</div><!-- .flex-container -->
	<div class="separator"></div>
	<?php endif;?>

	<?php
		$limit=get_option('colabs_latest_limit');
		$exclude=get_option('colabs_latest_exclude');
		if ($limit=='')$limit=8;
		$query_posts = new WP_query( array(
				'showposts' => $limit,
				'post_type' => 'post',
				'category__not_in' => $exclude
		));
		if($query_posts->have_posts()):
	?>
	<div class="main columns col11">
		<div class="stories columns col11">
        	<h2><?php _e('Latest Stories','colabsthemes');?></h2>
        	<ul>
            	<?php while ( $query_posts->have_posts() ) : $query_posts->the_post();?>
				<li class="columns col3">
                <a href="<?php the_permalink();?>" title="">
                    <h2><?php the_title();?></h2>
                	<?php colabs_image('width=238&height=158&play=true');?>
                    <?php colabs_custom_excerpt();?>
                </a>
                </li>
            	<?php endwhile;?>
            </ul>
        </div>
		<?php endif;?>

		<?php
		$latestreviews=get_option('colabs_latest_review');
		$count=count($latestreviews);
		$i=1;
		?>
        <div class="reviews column col7">
        <h2><?php _e('Latest Reviews','colabsthemes');?> <span class="section"><?php _e('on','colabsthemes');?>
		<?php if(!empty($latestreviews)):foreach ($latestreviews as $latestreview):
		$term = get_term( $latestreview, 'review_category' );
		?>
		<a href="#<?php echo $term->term_id;?>" title="<?php echo $term->name;?>">
		<?php echo $term->name;
		if ($i<$count) echo ' / ';?>
		</a>
		<?php $i++; endforeach;endif;?>
		</h2>
		<div>
        <?php
		if(!empty($latestreviews)):
		foreach ($latestreviews as $latestreview):
		$term = get_term( $latestreview, 'review_category' );
		$query_posts = new WP_query( array(
				'showposts' => 4,
				'post_type' => 'review',
				'tax_query' => array(
									array(
									'taxonomy' => 'review_category',
									'field' => 'id',
									'terms' => $term->term_id
									)
								)
		));
		if( $query_posts->have_posts()):
		?>

		<ul id="<?php echo $term->term_id;?>">
			<?php while ( $query_posts->have_posts() ) : $query_posts->the_post();?>
            <li class="column">
            	<a href="<?php the_permalink();?>" title=""><?php colabs_image('width=100&height=150');?></a>
            	<h3><?php the_title();?></h3>
            	<div class="rate" data="<?php echo get_rating($post->ID); ?>"></div>
			</li>
			<?php endwhile;?>
        </ul>
		<?php endif;endforeach;endif;?>
		</div>
        </div>

        <div class="map column col4">
	        <h2><?php _e('My Journey on Map','colabsthemes');?></h2>
	        <div id="googlemap" style="height:200px"></div>
	        <?php echo setMap(array( 'el' => 'googlemap' )); ?>
			<?php $enlarge=get_option('colabs_enlarge');
			if ($enlarge){
			?>
			<a href="<?php echo get_permalink($enlarge);?>" class="enlarge-button"><?php _e('Enlarge','colabsthemes');?></a>
			<?php }?>
        </div>
	</div><!-- .main -->

	<div class="main columns col11">

	<div class="col-stories columns col7 fl">
        <h2 class="ribbon"><?php _e('Stories','colabsthemes');?></h2>
		<?php $query_posts = new WP_query('post_type=post&paged='.$paged);?>
		<?php if($query_posts->have_posts()):?>
        <ul class="post-list">
			<?php while ( $query_posts->have_posts() ) : $query_posts->the_post(); ?>
                <li class="posting">
					<?php colabs_image(array());?>
					<h3><a href="<?php the_permalink();?>"><?php the_title();?></a></h3>
					<span class="bigred"><?php the_category(' ,');?><?php the_tags(' // ', ', ', '');?></span>
					<br/><?php colabs_custom_excerpt();?>
					<div class="more"><a href="<?php the_permalink();?>"><?php _e('read more','colabsthemes');?></a></div>
				</li>
            <?php endwhile; ?>
		</ul>
		<?php colabs_pagination('', $query_posts);?><!-- .pagination -->
		<?php endif;?>
    </div>

    <?php get_sidebar();?>
</div>

<?php get_footer(); ?>

And it is done!

Advertisements

5 thoughts on “Extra Posts On Travelous Theme

  1. I like what you guys are up too. Such smart work and reporting! Keep up the excellent works guys I have incorporated you guys to my blogroll. I think it will improve the value of my website :).

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s