Title: PHP code
Last modified: February 12, 2023

---

# PHP code

 *  Resolved [dplayer](https://wordpress.org/support/users/dplayer/)
 * (@dplayer)
 * [3 years, 5 months ago](https://wordpress.org/support/topic/php-code-77/)
 * I need to add the php wp_paginate code to my templates.
 * I can’t find it in the installation. Can you add this to the install docs?
 * This doesn’t work:
 *     ```wp-block-code
       <?php if(function_exists('wp_paginate')):
                   wp_paginate(); ?>
       ```
   

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

 *  Thread Starter [dplayer](https://wordpress.org/support/users/dplayer/)
 * (@dplayer)
 * [3 years, 5 months ago](https://wordpress.org/support/topic/php-code-77/#post-16462800)
 * Okay, I found this code and no error.
 *     ```wp-block-code
       <?php if(function_exists('wp_paginate')) {
          wp_paginate();
       } ?>e-bg px-5">  
       ```
   
 * Pagination shows up on my search results, but not category pages so far.
 * I use a custom theme so I will test and try.
 * I ha
 *  Plugin Author [AlanP57](https://wordpress.org/support/users/alanp57/)
 * (@alanp57)
 * [3 years, 5 months ago](https://wordpress.org/support/topic/php-code-77/#post-16465600)
 * In WordPress, the template used for category pages is determined by the theme
   you are using. Normally, the “category.php” template file is used to display 
   the content of category pages.
 * If the theme you are using doesn’t have a “category.php” file, WordPress will
   fall back to using the “archive.php” template file. If the theme doesn’t have
   an “archive.php” file either, it will use the “index.php” file. Try adding the
   code to one of these.

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

The topic ‘PHP code’ is closed to new replies.

 * ![](https://ps.w.org/wp-paginate/assets/icon-128x128.png?rev=1566512)
 * [WP-Paginate](https://wordpress.org/plugins/wp-paginate/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-paginate/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-paginate/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-paginate/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-paginate/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-paginate/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [AlanP57](https://wordpress.org/support/users/alanp57/)
 * Last activity: [3 years, 5 months ago](https://wordpress.org/support/topic/php-code-77/#post-16465600)
 * Status: resolved