Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)
  • Same error for me, have anyone solved it?

    Thread Starter FummeL

    (@fummel)

    Well it was more work than i thougt, this is what i ended up with:

    The code works but i still have 1 more styling problem, i want this html:

    first 3st divs of type: grid_4 should be nested with:
    <div class="wrapper p4">

    next 3st divs of type: grid_4:
    <div class="wrapper">

    <?php
        $args = array(
    	    'post_parent' => $post->ID,
    	    'post_type'   => 'page',
    	    'post_status' => 'publish',
    	    'numberposts' => -1,
            'depth' => 1
        );
    
        $postslist = get_posts($args);
    ?>
    
    <?php get_header(); ?>
    
    <section id="content">
    			<div class="main">
    				<div class="container_12">
    					<div class="wrapper">
    						<article class="grid_12">
    							<h3 class="p2">Behandlingar</h3>
                                <div class="wrapper p4">
                                <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
    
                                <?php
                                $i = 0;
                                foreach ( $postslist as $post ) :
                                $i++;
                                ?>
    
    		                    <?php setup_postdata( $post ); ?>
    								    <div class="grid_4<?php
                                                               if ($i == 1) { echo ' alpha'; }
                                                               elseif ($i == 3) { echo ' omega'; }
                                                               else { echo ''; } ?>">
                                        <?php
                                          if ($i == 2) {
                                              echo '<div class="indent-left3">';
                                          }
                                          elseif ($i == 3) {
                                              echo '<div class="indent-left2">';
                                          }
                                          else {
                                              echo '';
                                          }
                                        ?>
    									<div class="wrapper p2">
    										<figure class="border fleft">
                                                <?php
                                                    if ( has_post_thumbnail() ) {
                                                        the_post_thumbnail();
                                                    }
                                                    else { ?>
                                                        <img src="<?php bloginfo('template_directory'); ?>/img/page3-img3.jpg" alt="<?php the_title(); ?>" />
                                                <?php } ?>
                                            </figure>
    									</div>
    									<h6 class="prev-indent-bot">
                                            <a class="link" href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
                                        </h6>
    									<p class="indent-bot"><?php html5wp_excerpt('html5wp_index') ?></p>
    					                <a class="button" style="margin-bottom: 20px;" href="<?php the_permalink(); ?>">L?s mer/Boka tid</a>
    								</div>
                                        <?php
                                          if ($i == 2) {
                                              echo '</div>';
                                          }
                                          elseif ($i == 3) {
                                              echo '</div>';
                                          }
                                          else {
                                              echo '';
                                          }
                                        ?>
    
                                 <?php
                                    if ($i >= 3) {
                                        $i = 1;
                                    }
                                ?>
    					  <?php endforeach; ?>
    
    		<?php endwhile; endif; ?>
                                    </div>
    						</article>
    					</div>
    				</div>
    			</div>
    		</section>
    	</div>
    
    <?php get_footer(); ?>
    Thread Starter FummeL

    (@fummel)

    esmi you are the best ??

Viewing 3 replies - 1 through 3 (of 3 total)