Search
Search titles only
By:
Search titles only
By:
Log in
Register
Search
Search titles only
By:
Search titles only
By:
Menu
Install the app
Install
Forums
New posts
All threads
Latest threads
New posts
Trending threads
Trending
Search forums
What's new
New posts
New ads
New profile posts
Latest activity
Free Ads
Latest reviews
Search ads
Members
Current visitors
New profile posts
Search profile posts
Contact us
Latest ads
Puffin Rock Characters Plush Toy Set
anil1961
Updated:
Saturday at 3:51 PM
Toyota Vitz scp10 For Sale
Lakmal Bandara
Updated:
Wednesday at 10:50 AM
Kandy
Welcome all my all new pet shop Bark.lk
dilumrane
Updated:
Nov 2, 2026
Windows RDP Only Rs.500 a month
Blogerwiki
Updated:
Nov 1, 2026
Ad icon
V2ray VPN for Tunneling
hu KANNA
Updated:
Oct 22, 2026
Electronics
Vehicles
Property
Search
Reply to thread
Forums
General
ElaKiri Talk!
Wordpress Help Please
Get the App
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Message
<blockquote data-quote="amila_perera" data-source="post: 22148073" data-attributes="member: 375751"><p><?php</p><p>/**</p><p> * The main template file.</p><p> *</p><p> * Used to display the homepage when home.php doesn't exist.</p><p> */</p><p>$mts_options = get_option(MTS_THEME_NAME);</p><p>get_header();</p><p></p><p>$mts_home_layout = $mts_options['mts_home_layout'];</p><p>if ( 'full-width' == $mts_home_layout ) {</p><p> $pclass = 'page-featuredfull';</p><p> $thumb = 'ad-sense-featuredfull';</p><p>} elseif ( 'blog-width' == $mts_home_layout ) {</p><p> $pclass = 'page-featuredblog';</p><p> $thumb = 'ad-sense-traditionalfull';</p><p>} elseif ( 'isotope-width' == $mts_home_layout ) {</p><p> $pclass = 'page-featuredisotope';</p><p> $thumb = 'ad-sense-featuredfull';</p><p>} elseif ( 'grid-width-sidebar' == $mts_home_layout ) {</p><p> $pclass = 'page-featuredgridsidebar';</p><p> $thumb = 'ad-sense-traditionalfull';</p><p>} elseif ( 'traditional' == $mts_home_layout ) {</p><p> $pclass = 'page-traditional';</p><p> $thumb = 'ad-sense-traditionalfull';</p><p>} elseif ( 'traditional-with-full-thumb' == $mts_home_layout ) {</p><p> $pclass = 'page-traditional-full-thumb';</p><p> $thumb = 'ad-sense-traditionalfull';</p><p>} else { </p><p> $pclass = 'page-featured-default';</p><p> $thumb = 'ad-sense-featuredfull';</p><p>} ?></p><p></p><p><div id="page" class="<?php echo $pclass; ?>"></p><p> <div class="article"></p><p> <div id="content_box"></p><p> <?php if ( !is_paged() ) {</p><p></p><p> if ( is_home() && $mts_options['mts_featured_slider'] == '1' ) { ?></p><p></p><p> <div class="primary-slider-container clearfix loading"></p><p> <div id="slider" class="primary-slider"></p><p> <?php if ( empty( $mts_options['mts_custom_slider'] ) ) { ?></p><p> <?php</p><p> // prevent implode error</p><p> if ( empty( $mts_options['mts_featured_slider_cat'] ) || !is_array( $mts_options['mts_featured_slider_cat'] ) ) {</p><p> $mts_options['mts_featured_slider_cat'] = array('0');</p><p> }</p><p></p><p> $slider_cat = implode( ",", $mts_options['mts_featured_slider_cat'] );</p><p> $slider_query = new WP_Query('cat='.$slider_cat.'&posts_per_page='.$mts_options['mts_featured_slider_num']);</p><p> while ( $slider_query->have_posts() ) : $slider_query->the_post();</p><p> ?></p><p> <div class="item"> </p><p> <a href="<?php echo esc_url( get_the_permalink() ); ?>"></p><p> <?php the_post_thumbnail( $thumb, array('title' => '') ); ?></p><p> <div class="slide-caption"></p><p> <h2 class="slide-title"><?php the_title(); ?></h2></p><p> </div></p><p> </a> </p><p> </div></p><p> <?php endwhile; wp_reset_postdata(); ?></p><p> <?php } else { ?></p><p> <?php foreach( $mts_options['mts_custom_slider'] as $slide ) : ?></p><p> <div class="item"></p><p> <a href="<?php echo esc_url( $slide['mts_custom_slider_link'] ); ?>"></p><p> <?php echo wp_get_attachment_image( $slide['mts_custom_slider_image'], $thumb, false, array('title' => '') ); ?></p><p> <div class="slide-caption"></p><p> <h2 class="slide-title"><?php echo esc_html( $slide['mts_custom_slider_title'] ); ?></h2></p><p> </div></p><p> </a></p><p> </div></p><p> <?php endforeach; ?></p><p> <?php } ?></p><p> </div><!-- .primary-slider --></p><p> </div><!-- .primary-slider-container --></p><p></p><p> <?php }</p><p></p><p> $featured_categories = array();</p><p> if ( !empty( $mts_options['mts_featured_categories'] ) ) {</p><p> foreach ( $mts_options['mts_featured_categories'] as $section ) {</p><p> $category_id = $section['mts_featured_category'];</p><p> $featured_categories[] = $category_id;</p><p> $posts_num = $section['mts_featured_category_postsnum'];</p><p> if ( 'latest' == $category_id ) { ?></p><p> <?php if( $mts_options['mts_home_layout'] == 'isotope-width') { ?></p><p> <div class="content_wrap"></p><p> <?php } ?></p><p> <?php $j = 0; if ( have_posts() ) : while ( have_posts() ) : the_post(); ?></p><p> <article class="latestPost excerpt <?php echo (++$j % 3 == 0) ? 'last' : ''; ?>"></p><p> <?php mts_archive_post(); ?></p><p> </article></p><p> <?php endwhile; endif; ?></p><p> <?php if( $mts_options['mts_home_layout'] == 'isotope-width') { ?></p><p> </div></p><p> <?php } ?></p><p> </p><p> <?php if ( $j !== 0 ) { // No pagination if there is no posts ?></p><p> <?php mts_pagination(); ?></p><p> <?php } ?></p><p> </p><p> <?php } else { // if $category_id != 'latest': ?></p><p> <div class="latestPost-category-options"></p><p> <h3 class="featured-category-title"><a href="<?php echo esc_url( get_category_link( $category_id ) ); ?>" title="<?php echo esc_attr( get_cat_name( $category_id ) ); ?>"><?php echo esc_html( get_cat_name( $category_id ) ); ?></a></h3></p><p> <?php if( $mts_options['mts_home_layout'] == 'isotope-width') { ?></p><p> <div class="content_wrap"></p><p> <?php } ?></p><p> <?php</p><p> $j = 0;</p><p> $cat_query = new WP_Query('cat='.$category_id.'&posts_per_page='.$posts_num);</p><p> if ( $cat_query->have_posts() ) : while ( $cat_query->have_posts() ) : $cat_query->the_post(); ?></p><p> <article class="latestPost excerpt <?php echo (++$j % 3 == 0) ? 'last' : ''; ?>"></p><p> <?php mts_archive_post(); ?></p><p> </article></p><p> <?php</p><p> endwhile; endif; ?></p><p> <?php if( $mts_options['mts_home_layout'] == 'isotope-width') { ?></p><p> </div></p><p> <?php } ?></p><p> </div></p><p> <?php wp_reset_postdata();</p><p> }</p><p> }</p><p> }</p><p> } else { //Paged</p><p> if( $mts_options['mts_home_layout'] == 'isotope-width') { ?></p><p> <div class="content_wrap"></p><p> <?php } ?></p><p> <?php $j = 0; if ( have_posts() ) : while ( have_posts() ) : the_post(); ?></p><p> <article class="latestPost excerpt <?php echo (++$j % 3 == 0) ? 'last' : ''; ?>"></p><p> <?php mts_archive_post(); ?></p><p> </article></p><p> <?php endwhile; endif; ?></p><p> <?php if( $mts_options['mts_home_layout'] == 'isotope-width') { ?></p><p> </div></p><p> <?php } ?></p><p> <?php if ( $j !== 0 ) { // No pagination if there is no posts ?></p><p> <?php mts_pagination(); ?></p><p> <?php } ?></p><p></p><p> <?php } ?></p><p> </div></p><p> </div></p><p> <?php if( 'featured-width' != $mts_home_layout && 'isotope-width' != $mts_home_layout && 'full-width' != $mts_home_layout ) get_sidebar(); ?></p><p><?php get_footer(); ?></p></blockquote><p></p>
[QUOTE="amila_perera, post: 22148073, member: 375751"] <?php /** * The main template file. * * Used to display the homepage when home.php doesn't exist. */ $mts_options = get_option(MTS_THEME_NAME); get_header(); $mts_home_layout = $mts_options['mts_home_layout']; if ( 'full-width' == $mts_home_layout ) { $pclass = 'page-featuredfull'; $thumb = 'ad-sense-featuredfull'; } elseif ( 'blog-width' == $mts_home_layout ) { $pclass = 'page-featuredblog'; $thumb = 'ad-sense-traditionalfull'; } elseif ( 'isotope-width' == $mts_home_layout ) { $pclass = 'page-featuredisotope'; $thumb = 'ad-sense-featuredfull'; } elseif ( 'grid-width-sidebar' == $mts_home_layout ) { $pclass = 'page-featuredgridsidebar'; $thumb = 'ad-sense-traditionalfull'; } elseif ( 'traditional' == $mts_home_layout ) { $pclass = 'page-traditional'; $thumb = 'ad-sense-traditionalfull'; } elseif ( 'traditional-with-full-thumb' == $mts_home_layout ) { $pclass = 'page-traditional-full-thumb'; $thumb = 'ad-sense-traditionalfull'; } else { $pclass = 'page-featured-default'; $thumb = 'ad-sense-featuredfull'; } ?> <div id="page" class="<?php echo $pclass; ?>"> <div class="article"> <div id="content_box"> <?php if ( !is_paged() ) { if ( is_home() && $mts_options['mts_featured_slider'] == '1' ) { ?> <div class="primary-slider-container clearfix loading"> <div id="slider" class="primary-slider"> <?php if ( empty( $mts_options['mts_custom_slider'] ) ) { ?> <?php // prevent implode error if ( empty( $mts_options['mts_featured_slider_cat'] ) || !is_array( $mts_options['mts_featured_slider_cat'] ) ) { $mts_options['mts_featured_slider_cat'] = array('0'); } $slider_cat = implode( ",", $mts_options['mts_featured_slider_cat'] ); $slider_query = new WP_Query('cat='.$slider_cat.'&posts_per_page='.$mts_options['mts_featured_slider_num']); while ( $slider_query->have_posts() ) : $slider_query->the_post(); ?> <div class="item"> <a href="<?php echo esc_url( get_the_permalink() ); ?>"> <?php the_post_thumbnail( $thumb, array('title' => '') ); ?> <div class="slide-caption"> <h2 class="slide-title"><?php the_title(); ?></h2> </div> </a> </div> <?php endwhile; wp_reset_postdata(); ?> <?php } else { ?> <?php foreach( $mts_options['mts_custom_slider'] as $slide ) : ?> <div class="item"> <a href="<?php echo esc_url( $slide['mts_custom_slider_link'] ); ?>"> <?php echo wp_get_attachment_image( $slide['mts_custom_slider_image'], $thumb, false, array('title' => '') ); ?> <div class="slide-caption"> <h2 class="slide-title"><?php echo esc_html( $slide['mts_custom_slider_title'] ); ?></h2> </div> </a> </div> <?php endforeach; ?> <?php } ?> </div><!-- .primary-slider --> </div><!-- .primary-slider-container --> <?php } $featured_categories = array(); if ( !empty( $mts_options['mts_featured_categories'] ) ) { foreach ( $mts_options['mts_featured_categories'] as $section ) { $category_id = $section['mts_featured_category']; $featured_categories[] = $category_id; $posts_num = $section['mts_featured_category_postsnum']; if ( 'latest' == $category_id ) { ?> <?php if( $mts_options['mts_home_layout'] == 'isotope-width') { ?> <div class="content_wrap"> <?php } ?> <?php $j = 0; if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> <article class="latestPost excerpt <?php echo (++$j % 3 == 0) ? 'last' : ''; ?>"> <?php mts_archive_post(); ?> </article> <?php endwhile; endif; ?> <?php if( $mts_options['mts_home_layout'] == 'isotope-width') { ?> </div> <?php } ?> <?php if ( $j !== 0 ) { // No pagination if there is no posts ?> <?php mts_pagination(); ?> <?php } ?> <?php } else { // if $category_id != 'latest': ?> <div class="latestPost-category-options"> <h3 class="featured-category-title"><a href="<?php echo esc_url( get_category_link( $category_id ) ); ?>" title="<?php echo esc_attr( get_cat_name( $category_id ) ); ?>"><?php echo esc_html( get_cat_name( $category_id ) ); ?></a></h3> <?php if( $mts_options['mts_home_layout'] == 'isotope-width') { ?> <div class="content_wrap"> <?php } ?> <?php $j = 0; $cat_query = new WP_Query('cat='.$category_id.'&posts_per_page='.$posts_num); if ( $cat_query->have_posts() ) : while ( $cat_query->have_posts() ) : $cat_query->the_post(); ?> <article class="latestPost excerpt <?php echo (++$j % 3 == 0) ? 'last' : ''; ?>"> <?php mts_archive_post(); ?> </article> <?php endwhile; endif; ?> <?php if( $mts_options['mts_home_layout'] == 'isotope-width') { ?> </div> <?php } ?> </div> <?php wp_reset_postdata(); } } } } else { //Paged if( $mts_options['mts_home_layout'] == 'isotope-width') { ?> <div class="content_wrap"> <?php } ?> <?php $j = 0; if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> <article class="latestPost excerpt <?php echo (++$j % 3 == 0) ? 'last' : ''; ?>"> <?php mts_archive_post(); ?> </article> <?php endwhile; endif; ?> <?php if( $mts_options['mts_home_layout'] == 'isotope-width') { ?> </div> <?php } ?> <?php if ( $j !== 0 ) { // No pagination if there is no posts ?> <?php mts_pagination(); ?> <?php } ?> <?php } ?> </div> </div> <?php if( 'featured-width' != $mts_home_layout && 'isotope-width' != $mts_home_layout && 'full-width' != $mts_home_layout ) get_sidebar(); ?> <?php get_footer(); ?> [/QUOTE]
Insert quotes…
Verification
Awruddata maasa keeyada?
Post reply
Top
Bottom