Title: bbclone w/ WordPress 2
Last modified: August 18, 2016

---

# bbclone w/ WordPress 2

 *  [muzicman82](https://wordpress.org/support/users/muzicman82/)
 * (@muzicman82)
 * [19 years, 1 month ago](https://wordpress.org/support/topic/bbclone-w-wordpress-2/)
 * Hello folks. I’m not new to bbclone by any means, but this is my first try at
   putting it in a WordPress site.
 * I’ve read many forum and blog posts that suggest adding code to each template
   file, such as index.php, archive.php, page.php, single.php, etc.
 * I’ve also read suggestions about adding a single piece of code to wp-blog-header.
   php.
 * Both of the above suggestions work, but it seems that both incorrectly track 
   visits. For example, if I add code to the wp-blog-header.php file, it seems to
   add 2-4 hits for every single visit to an archive page. Now, that’s not accurate
   is it?
 * I’m trying to understand why I can’t add bbclone code to my header.php file and
   be done. There, it doesn’t track at all. However, this seems to be the one template
   file that is used on every page, and only once.
 * I’d like a SINGLE place to add this code.
 * The code I’m using is this:
 *     ```
       <?php
       if (is_home() == true) {
       	$pagetitle = "Home";
       	}
       else {
       	$pagetitle = wp_title('', false);
       	}
   
       define("_BBC_PAGE_NAME", $pagetitle);
       define("_BBCLONE_DIR", "bbclone/");
       define("COUNTER", _BBCLONE_DIR."mark_page.php");
       if (is_readable(COUNTER)) { include_once(COUNTER); }
       else { echo "Counter is broken."; }
   
       ?>
       ```
   
 * Thanks.

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

 *  [txmom](https://wordpress.org/support/users/txmom/)
 * (@txmom)
 * [18 years, 5 months ago](https://wordpress.org/support/topic/bbclone-w-wordpress-2/#post-561381)
 * Thanks for the code. I’d moved my blog to a new host, and needed to install a
   stats program.
 * I found this post while searching for how best to edit code, it works, thanks.
   As to where we put the code, we added it to template-loader.php in the wp-includes
   folder.
 * So I didn’t forget how, had help, I wrote down the steps on a blog post [adding bbclone to wordpress](https://wordpress.org/support/topic/bbclone-w-wordpress-2/template-loader.php in the wp-includes folder?output_format=md).
 *  [jamessnell](https://wordpress.org/support/users/jamessnell/)
 * (@jamessnell)
 * [18 years, 2 months ago](https://wordpress.org/support/topic/bbclone-w-wordpress-2/#post-561393)
 * Sadly your link is dead and I’d love to have that content! Ohh why cruel world
   why!?
 *  [jamessnell](https://wordpress.org/support/users/jamessnell/)
 * (@jamessnell)
 * [18 years, 2 months ago](https://wordpress.org/support/topic/bbclone-w-wordpress-2/#post-561394)
 * I’ve been grinding on this for awhile now.. Sadly, I can’t quite get bbclone 
   to work. I created a test page and that works fine..
 * I’ve confirmed that bbclone is being called using some echo statements. However
   it seems to quit prematurely in the bbclone code:
 *     ```
       // Don't process anything unless we are told to do so
         if (!defined("_OK")) {
           if (empty($BBC_DEBUG)) return ignore_user_abort(0);
           else exit($i);
         }
       ```
   
 * I’m really not sure what is going on here, but it’s sort of driving me totally
   nuts! 🙂
 *  [jamessnell](https://wordpress.org/support/users/jamessnell/)
 * (@jamessnell)
 * [18 years, 2 months ago](https://wordpress.org/support/topic/bbclone-w-wordpress-2/#post-561399)
 * Okay, I’ve got it.. Thanks to this site: [http://www.iltchev.com/?page_id=11](http://www.iltchev.com/?page_id=11)
 * Just in case that site gets nuked or something here’s the info I used:
 *     ```
       Modify wp-blog-header.php:
   
       ...
       gzip_compression();
   
       //-- Insert BBclone Code from here @
       define("_BBC_PAGE_NAME", get_bloginfo("name") . wp_title("/", false));
       define("_BBCLONE_DIR", "/full/path/to/bbclone/");
       define("COUNTER", _BBCLONE_DIR."mark_page.php");
       if (is_readable(COUNTER)) include_once(COUNTER);
       //-- @ to Here
   
       require_once(ABSPATH . WPINC . '/template-loader.php');
   
       endif;
       ```
   
 * my wp-blog-header.php didn’t have that gzip line, I just inserted the bbclone
   call right before the template-loader and it’s working fine. I’m running this
   on WP 2.5 and seems good. Yay!

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

The topic ‘bbclone w/ WordPress 2’ is closed to new replies.

## Tags

 * [bbclone](https://wordpress.org/support/topic-tag/bbclone/)
 * [template](https://wordpress.org/support/topic-tag/template/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 4 replies
 * 3 participants
 * Last reply from: [jamessnell](https://wordpress.org/support/users/jamessnell/)
 * Last activity: [18 years, 2 months ago](https://wordpress.org/support/topic/bbclone-w-wordpress-2/#post-561399)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
