WordPress.org

Ready to get started?Download WordPress

Forums

WordPress Hit Counter
How can we place this hitcounter in template? (3 posts)

  1. thiruarasu
    Member
    Posted 2 years ago #

    hi,

    I using Hit Counter plug-in...

    is there any possibilities to place the counter in template directly wherever we want?

    Thanks with regards,
    Thiru

    http://wordpress.org/extend/plugins/wordpress-hit-counter/

  2. PaweĊ‚ Nowak
    Member
    Posted 1 year ago #

    You can use some plugin like this one: or call this widget via shortcode:

    Tutorial:

    http://digwp.com/2010/04/call-widget-with-shortcode/

    When you put this code in your function.php simply use this shortcode:

    [widget widget_name="wHitCounter"]

    and your Hit Counter should appear... ;)

    Cheers ;)

  3. joshrodgers
    Member
    Posted 1 year ago #

    Ok,

    Usually I don't like to modifying a plugin directly because when you update the plugin you have to be careful or you'll overwrite your code, however I do feel this is an enhancement to the plugin and I have a custom set of digits anyway - so I don't really think it matters at this point. If you'd like to add shortcode functionality to the plugin, the process is very simple:

    • Navigate to your plugins folder > wordpress-hit-counter
    • Open image.php and add the following function right before the ?> close: http://pastebin.com/79BSjikg
    • Save your file

    *If you'd like to add it to a page just use the shortcode: [wHitCounter]

    *If you'd like to add it to your template, wherever you'd like to see the counter use the following code: <?php echo do_shortcode("[wHitCounter]"); ?>

    Simple as that! Hope it helps :-)

    Josh

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic