Title: Please help me insert this code in a wordpress php theme file.
Last modified: August 24, 2016

---

# Please help me insert this code in a wordpress php theme file.

 *  [CodeRookie](https://wordpress.org/support/users/coderookie/)
 * (@coderookie)
 * [11 years ago](https://wordpress.org/support/topic/please-help-me-insert-this-code-in-a-wordpress-php-theme-file/)
 * On my previous theme that I was customizing, I wanted to insert an ad banner 
   into a wordpress theme home page footer. Below is the original code at the end
   of the home page php template.
 *     ```
       </article>
       <?php
               if ($i  % 3 == 2) { echo '</div>'; }
               $i++;
               endwhile;
               if ($cb_closer == true) {echo '</div>';}
               cb_page_navi();
               endif;
       ?>
       ```
   
 * I figured out I can achieve this by inserting my ad like below. I did that and
   it worked like a charm.
 * ?> insert ad code here <?php cb_page_navi();
 * Now I need to achieve same for a new theme that has following home page php code
   at the bottom. I tried above method but it did not work.
 *     ```
       </article>
   
       <?php
               $cb_count++;
               endwhile;
               cb_page_navi( $cb_qry );
               endif;
       ?>
       ```
   
 * Can someone please help how to ad my banner code on footer above pagination?

The topic ‘Please help me insert this code in a wordpress php theme file.’ is closed
to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 0 replies
 * 1 participant
 * Last reply from: [CodeRookie](https://wordpress.org/support/users/coderookie/)
 * Last activity: [11 years ago](https://wordpress.org/support/topic/please-help-me-insert-this-code-in-a-wordpress-php-theme-file/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
