Title: loop for banner li
Last modified: August 19, 2016

---

# loop for banner li

 *  [czone](https://wordpress.org/support/users/czone/)
 * (@czone)
 * [15 years, 4 months ago](https://wordpress.org/support/topic/loop-for-banner-li/)
 * Hello friends,
    I created an option page in my theme where the user can enable
   or disable banner display in sidebar and also select the number of banners to
   display.
 * TO enable and disable banners display I used the IF statement
 * `<?php if ( get_option('czr2_ads') == "Enable") { ?>`
 * And within this statement I inserted UL LI tages with <A href … <img ..
 * **PROBLEM:**
    I need to wrap the LI tag under a “WHILE” loop but I dont know 
   how to do that, I tried something like this
 * `<?php while ( get_option('czr2_big_ads_number') <= "2") { ?>`
    But this flooded
   the sidebar.
 * Friends kindly help me to create the proper “While” loop and also few fields 
   below it i.e. how to add the link and img source for each li.

The topic ‘loop for banner li’ is closed to new replies.

 * 0 replies
 * 1 participant
 * Last reply from: [czone](https://wordpress.org/support/users/czone/)
 * Last activity: [15 years, 4 months ago](https://wordpress.org/support/topic/loop-for-banner-li/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
