• Resolved Pia1973

    (@pia1973)


    Please can somebody help me this is a exame project

    I have this index page (link) and this 18 boxs I have to make theme as categories but how??
    And the boxes is style with css
    My code look like this:

    <?php get_header();?>
        <div id="mainContent">
                    <a href="#"><div id="box1"><img src="<?php bloginfo('template_url');?>/css/icon/1.png" alt="Patientfolder" width="35" height="30"/></div></a>
                    <a href="#"><div id="box2"><img src="<?php bloginfo('template_url');?>/css/icon/1.png" alt="Patientfolder" width="35" height="30"/></div></a>
                    <a href="#"><div id="box3"><img src="<?php bloginfo('template_url');?>/css/icon/1.png" alt="Patientfolder" width="35" height="30"/></div></a>
                    <a href="#"><div id="box4"><img src="<?php bloginfo('template_url');?>/css/icon/1.png" alt="Patientfolder" width="35" height="30"/></div></a>
                    <a href="#"><div id="box5"><img src="<?php bloginfo('template_url');?>/css/icon/1.png" alt="Patientfolder" width="35" height="30"/></div></a>
                    <a href="#"><div id="box6"><img src="<?php bloginfo('template_url');?>/css/icon/1.png" alt="Patientfolder" width="35" height="30"/></div></a>
                    <a href="#"><div id="box7"><img src="<?php bloginfo('template_url');?>/css/icon/1.png" alt="Patientfolder" width="35" height="30"/></div></a>
                    <a href="#"><div id="box8"><img src="<?php bloginfo('template_url');?>/css/icon/1.png" alt="Patientfolder" width="35" height="30"/></div></a>
                    <a href="#"><div id="box9"><img src="<?php bloginfo('template_url');?>/css/icon/1.png" alt="Patientfolder" width="35" height="30"/></div></a>
                    <a href="#"><div id="box10"><img src="<?php bloginfo('template_url');?>/css/icon/1.png" alt="Patientfolder" width="35" height="30"/></div></a>
                    <a href="#"><div id="box11"><img src="<?php bloginfo('template_url');?>/css/icon/1.png" alt="Patientfolder" width="35" height="30"/></div></a>
                    <a href="#"><div id="box12"><img src="<?php bloginfo('template_url');?>/css/icon/1.png" alt="Patientfolder" width="35" height="30"/></div></a>
                    <a href="#"><div id="box13"><img src="<?php bloginfo('template_url');?>/css/icon/1.png" alt="Patientfolder" width="35" height="30"/></div></a>
                    <a href="#"><div id="box14"><img src="<?php bloginfo('template_url');?>/css/icon/1.png" alt="Patientfolder" width="35" height="30"/></div></a>
                    <a href="#"><div id="box15"><img src="<?php bloginfo('template_url');?>/css/icon/1.png" alt="Patientfolder" width="35" height="30"/></div></a>
                    <a href="#"><div id="box16"><img src="<?php bloginfo('template_url');?>/css/icon/1.png" alt="Patientfolder" width="35" height="30"/></div></a>
                    <a href="#"><div id="box17"><img src="<?php bloginfo('template_url');?>/css/icon/1.png" alt="Patientfolder" width="35" height="30"/></div></a>
                    <a href="#"><div id="box18"><img src="<?php bloginfo('template_url');?>/css/icon/1.png" alt="Patientfolder" width="35" height="30"/></div></a>
                </div><!-- END #mainContent -->
    <?php get_footer();?>

Viewing 6 replies - 16 through 21 (of 21 total)
  • Thread Starter Pia1973

    (@pia1973)

    now is the last box gone, I don´t get it 🙁

    Thread Starter Pia1973

    (@pia1973)

    plaese have a look at my site an tell me what I am doing wrong

    http://skrivers-shop.dk/wordpress/

    my code look like this now:

    <?php get_header();?>

    <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>

    <div id=”mainContent”>
    <?php $cats = get_categories( array( ‘hide_empty’ => 1, ‘number’ => 18 ) );
    $counter = 0;
    foreach( $cats as $cat ) {
    $counter++; ?>
    <div id=”box<?php echo $counter; ?>”>term_id ); ?>”><img src=”<?php bloginfo(‘template_url’);?>/css/icon/<?php echo $counter; ?>.png” alt=”<?php echo esc_attr( $cat->name ); ?>” width=”35″ height=”30″/></div>
    <?php } //end of the foreach// ?>

    </div><!– END #mainContent –>

    <?php if ( in_category( ‘3’ ) ) : ?>
    <div class=”post-cat-three”>
    <?php else : ?>
    <div class=”post”>
    <?php endif; ?>

    <!– Display the Post’s content in a div box. –>

    <div class=”entry”>
    <?php the_content(); ?>
    </div>

    <!– Display a comma separated list of the Post’s Categories. –>
    <p class=”postmetadata”>
    Posted in <?php the_category(‘, ‘) ?>
    |
    <?php edit_post_link(‘Edit’,”,’|‘); ?>
    </p>
    </div> <!– closes the first div box –>

    <!– Stop The Loop (but note the “else:” – see next line). –>
    </div><!– END #mainContent –>
    <?php endwhile; else : ?>

    <!– The very first “if” tested to see if there were any Posts to –>
    <!– display. This “else” part tells what do if there weren’t any. –>
    <p><?php _e( ‘Sorry, no posts matched your criteria.’ ); ?></p>

    <!– REALLY stop The Loop. –>
    <?php endif; ?>
    <?php get_footer();?>

    Thread Starter Pia1973

    (@pia1973)

    Have got it working now.
    it just have to be in numerical order ?
    how am I going to that?

    Thread Starter Pia1973

    (@pia1973)

    And I still miss box nr 18 the last one ???? How am I going to get that back?

    Thread Starter Pia1973

    (@pia1973)

    I have it back the box nr 18:)

    I need a specific icon per category how am I going to that and how do I get a specific order for the categories?

    thank you is working !

Viewing 6 replies - 16 through 21 (of 21 total)

The topic ‘18 boxes in wordpress’ is closed to new replies.