The MU forums have moved to WordPress.org

how to add count code in all pages .. (3 posts)

  1. A7la3alm
    Member
    Posted 16 years ago #

    Hellow,

    how to add count code in all pages ..?

    is that by adding the code at all themes I have in wpmu?

    or can I add the code to file like index.php in wpmu?

    can any one tell me the best way that I can do that?..

  2. A7la3alm
    Member
    Posted 16 years ago #

    up

  3. dsader
    Member
    Posted 16 years ago #

    Make a plugin. Any .php file dropped into mu-plugins activates sitewide. add_action "hooks" your function to a hook already coded in the template. There are tonnes of actions to add this to. Look for the wp_footer action in the theme footer.php, most if not all do.

    Upload a php file to mu-plugins with the following:

    <?php function wpmu_counter_in_footer($blah)
    {
    ?>
    My Counter script.
    <?php
      return $blah;
    }
    add_action('wp_footer', 'wpmu_footer');
    ?>

About this Topic