Title: 18 boxes in wordpress
Last modified: August 22, 2016

---

# 18 boxes in wordpress

 *  Resolved [Pia1973](https://wordpress.org/support/users/pia1973/)
 * (@pia1973)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/18-boxes-in-wordpress/)
 * Please can somebody help me this is a exame project
 * I have this index page [(link)](http://skrivers-shop.dk/wordpress/) 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 15 replies - 1 through 15 (of 21 total)

1 [2](https://wordpress.org/support/topic/18-boxes-in-wordpress/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/18-boxes-in-wordpress/page/2/?output_format=md)

 *  Thread Starter [Pia1973](https://wordpress.org/support/users/pia1973/)
 * (@pia1973)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/18-boxes-in-wordpress/#post-5364557)
 * [http://skrivers-shop.dk/wordpress/](http://skrivers-shop.dk/wordpress/)
 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/18-boxes-in-wordpress/#post-5364610)
 * > I have to make theme as categories
 * what exactly are you trying to show per box?
 *  Thread Starter [Pia1973](https://wordpress.org/support/users/pia1973/)
 * (@pia1973)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/18-boxes-in-wordpress/#post-5364616)
 * each box is a link to a category and there will be 18 categories
 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/18-boxes-in-wordpress/#post-5364629)
 * will there be only exactly 18 categories in your site?
    do you need a specific
   order for the categories, like alphabetic? do you need a specific icon per category?
   do you want to link each box to the category archive page of the category?
 * assuming you answer ‘yes’ to each of the questions, then an example code would
   be:
 *     ```
       <?php get_header();?>
       		<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; ?>"><a href="<?php echo get_category_link( $cat->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"/></a></div>
       <?php } //end of the foreach// ?>
   
       		</div><!-- END #mainContent -->
       <?php get_footer();?>
       ```
   
 * you will need icon images **1.png**, **2.png**, etc corresponding to the categories.
 * [http://codex.wordpress.org/Function_Reference/get_categories](http://codex.wordpress.org/Function_Reference/get_categories)
 *  Thread Starter [Pia1973](https://wordpress.org/support/users/pia1973/)
 * (@pia1973)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/18-boxes-in-wordpress/#post-5364638)
 * will there be only exactly 18 categories in your site?: YES
    do you need a specific
   order for the categories, like alphabetic?: YES do you need a specific icon per
   category?: YES do you want to link each box to the category archive page of the
   category?: YES
 * I have icon for each category 🙂
 *  Thread Starter [Pia1973](https://wordpress.org/support/users/pia1973/)
 * (@pia1973)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/18-boxes-in-wordpress/#post-5364640)
 * Thanks 🙂
 * It should be such that when you click on categorien (box) that you enter the 
   category page
 *  Thread Starter [Pia1973](https://wordpress.org/support/users/pia1973/)
 * (@pia1973)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/18-boxes-in-wordpress/#post-5364643)
 * and on this site under categories I would like to have a search form 🙂 please
 *  Thread Starter [Pia1973](https://wordpress.org/support/users/pia1973/)
 * (@pia1973)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/18-boxes-in-wordpress/#post-5364644)
 * or a search form on the index page 🙂
 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/18-boxes-in-wordpress/#post-5364647)
 * re: search form
 * [http://codex.wordpress.org/Function_Reference/get_search_form](http://codex.wordpress.org/Function_Reference/get_search_form)
 *  Thread Starter [Pia1973](https://wordpress.org/support/users/pia1973/)
 * (@pia1973)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/18-boxes-in-wordpress/#post-5364649)
 * I am a newbeen in this so I am not so good at it so cut you please help me
 * when I clike on the box I like to get into the page for the categorie
 * the search form I think I can fix it by my self
 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/18-boxes-in-wordpress/#post-5364651)
 * > when I clike on the box I like to get into the page for the categorie
 * that should happen automatically (?)
 * what file name are you using for the boxes?
 * if you intend the boxes to be on the home page, possibly rename the file to **
   front-page.php** and create an **index.php** with the default loop.
 * [http://codex.wordpress.org/Template_Hierarchy](http://codex.wordpress.org/Template_Hierarchy)
   
   [http://codex.wordpress.org/The_Loop](http://codex.wordpress.org/The_Loop)
 *  Thread Starter [Pia1973](https://wordpress.org/support/users/pia1973/)
 * (@pia1973)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/18-boxes-in-wordpress/#post-5364659)
 * the site where the boxes is on is called index.php
    I’m not sure what you mean
 *  Thread Starter [Pia1973](https://wordpress.org/support/users/pia1973/)
 * (@pia1973)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/18-boxes-in-wordpress/#post-5364670)
 * I can´t see what I am doing wrong
    please help me
 * [http://skrivers-shop.dk/wordpress/](http://skrivers-shop.dk/wordpress/)
 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/18-boxes-in-wordpress/#post-5364671)
 * > I’m not sure what you mean
 * **index.php** is used when no other, more specific template exists in your theme;
   
   read [http://codex.wordpress.org/Template_Hierarchy](http://codex.wordpress.org/Template_Hierarchy)
 * that means, that your category page is using index.php which is obviously in 
   your case very specialized, and does not contain the general loop.
 *  Thread Starter [Pia1973](https://wordpress.org/support/users/pia1973/)
 * (@pia1973)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/18-boxes-in-wordpress/#post-5364673)
 * yes but how am I getting it to work
 * I have tried to make a frontpage with the boks code in and the loop on the index
   file but it don´t work
 *  you can write the code to be on the front page and the code to the index
    please
   please

Viewing 15 replies - 1 through 15 (of 21 total)

1 [2](https://wordpress.org/support/topic/18-boxes-in-wordpress/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/18-boxes-in-wordpress/page/2/?output_format=md)

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

 * 21 replies
 * 3 participants
 * Last reply from: [mayhicksatl](https://wordpress.org/support/users/mayhicksatl/)
 * Last activity: [11 years, 7 months ago](https://wordpress.org/support/topic/18-boxes-in-wordpress/page/2/#post-5364722)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
