1

Here is the template code

<?php
/**
* The template used for Home page */
?>

<section id="mosaicPosts">
<!-- MosaicPost-->
<div id="mosaicTiles" class="clearfix">

<?php
    global $post;

    $numberposts = esc_attr( get_theme_mod( 'number_homeposts', '6' ) );

    $args = array(
        'post_status'    => 'publish',
        'post__not_in'   => get_option( 'sticky_posts' ),
        'tax_query'      => array(
            array(
                'taxonomy' => 'post_format',
                'terms'    => array( 'post-format-image' ),
                'field'    => 'slug',
                'operator' => 'IN',
            ),
        ),
        'numberposts' => $numberposts
    );
    $home_posts = get_posts($args);
?>
<?php if( $home_posts ) { ?>

<?php
$num = 0;
foreach( $home_posts as $post ) : setup_postdata( $post );
?>

<?php  if ( $num == 6 ){ $num = 1; } else { $num++; } ?>

<?php  if ( $num == 2 ){ $class = 'vertical'; } ?>
<?php  if ( $num == 3 || $num == 4 ){ $class = 'rectangle'; } ?>
<?php  if ( $num == 1 || $num == 5 ){ $class = 'big-square'; } ?>
<?php  if ( $num == 6 ){ $class = 'big-rectangle'; } ?>

<div class="box <?php echo $class; ?>">
    <?php get_template_part( 'template-parts/layout', 'tiles' ); ?>
</div>

    <?php
endforeach;
wp_reset_postdata();
?>

<?php } // if( $home_posts ) ?>

</div><!-- #mosaicTiles -->
</section>

<?php if ( is_active_sidebar( 'home-top' ) ) { ?>
<section id="prebefore-home-widget">

    <?php dynamic_sidebar( 'home-top' ); ?>

</section>
<?php } ?>

<?php if ( is_active_sidebar( 'home-above' ) ) { ?>
<section id="before-home-widget">

<div class="grid<?php $sidebars_widgets = wp_get_sidebars_widgets(); echo count($sidebars_widgets['home-above']); ?> clearfix">
    <?php dynamic_sidebar( 'home-above' ); ?>
</div>

</section>
<?php } ?>

<?php get_template_part( 'template-parts/section', 'home-page' ); ?>

<?php if ( is_active_sidebar( 'home-below' ) ) { ?>
<section id="after-home-widget">

<div class="grid<?php $sidebars_widgets = wp_get_sidebars_widgets(); echo count($sidebars_widgets['home-below']); ?> clearfix">
    <?php dynamic_sidebar( 'home-below' ); ?>
</div>

</section>
<?php } ?>

I've tried using the get_ function but only seem to get 503 errors in return. Any help is greatly appreciated.

0

At be top of your template code:

<?php
/**
* The template used for Home page
?>

You never closed the comment with a */ which is commenting out the rest of your code. It should look like this:

<?php
/**
* The template used for Home page */
?>
  • @MarioEspinoza Be sure to click the green checkmark next to my answer and upvote this to indicate that your question is solved. – Ethan Jinks O'Sullivan Aug 28 '16 at 12:03
  • that didnt solve my problem though, just the way it appeared on the site. – Mario Espinoza Aug 28 '16 at 16:43
  • @MarioEspinoza I don't entirely understand your question other than missing the */ in your comment. Please update it to clarify what you want to do. Treat it as if we don't know anything and explain everything that is relevant so everyone can get a better idea on your current situation. – Ethan Jinks O'Sullivan Aug 28 '16 at 18:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.