Dashboard stats in my sidebar (15 posts)

  1. spaceninja
    Posted 11 years ago #

    I would like to get the same stats that are already displayed on my dashboard onto my sidebar. I know there are plugins for this out there, but most are complete overkill, especially when I can see that the code for this is already included in the product. Anyone have any ideas?

  2. Kafkaesqui

    Posted 11 years ago #

    Why not go into wp-admin/index.php (i.e. the Dashboard file) and copy the code sections you want?

  3. spaceninja
    Posted 11 years ago #

    I tried that - it doesn't work. I'm guessing the admin area has some different tags available that aren't available in the main template pages, or I'm missing something.

  4. Kafkaesqui

    Posted 11 years ago #

    "it doesn't work"

    Doesn't explain a lot. If you can specify which particular features of the Dashboard you want to transfer to your blog, maybe we can piece it together, together.

  5. plainsman
    Posted 11 years ago #

    I have tried to 'borrow' certain sections of wp-admin/index.php with varying success.

    It is, of course, my lack of PHP knowledge that causes it. Sorry.

    I was able to take "Blog Stats" and put it in the sidebar, but not things like 'Incoming Links' and 'Comments' (I'd really like to have recent comments on the sidebar.)

    Here is the site where I'm trying to do it.


    Any help as to what to take, not take, from the wp-admin/index.php to get the "Incoming Links" and "Comments" would be great.

    Edit: By the way, I'm using the Obsidian theme with sidebar, if that matters.


  6. plainsman
    Posted 11 years ago #

    OK, actually got "Recent Comments" to work, thanks to this link:


    Now, to see about "Inbound Links"? Any ideas?

    and, now seem to have found that at:


    so, please disregard and forgive my questions .... should have been paying attention and searched for "Incoming Links" rather than "inbound" ... sheez...

  7. reevo
    Posted 11 years ago #

    I was just thinking about this whole thing and wondering WHY there's not some simple code that can be included (like in the Dashboard) to get this on the index page. Any ideas?

  8. piginzen
    Posted 11 years ago #

    I've been trying to do the same with Inbound Links,

    and i've tried this code with no luck:
    $rss = @fetch_rss('http://feeds.technorati.com/cosmos/rss/?url='. trailingslashit(get_option('home')) .'&partner=wordpress');
    if ( isset($rss->items) && 0 != count($rss->items) ) {
    <div id="incominglinks">
    <h3><?php _e('Incoming Links'); ?> <cite>&partner=wordpress"><?php _e('More'); ?> »</cite></h3>

    <?php } ?>

  9. James Huff
    Support Representative
    Posted 11 years ago #

    Try one of the recent Statistics plugins:


  10. piginzen
    Posted 11 years ago #


    Thanks for your effort, but there is nothing in that URL you supplied that answered my question about having "Inbound Links" show up on my sidebar. Am I missing something here?

    I think having some sort of link between Technorati links and my site would be great and simple to do with that code above... But it appear it's only fully functional in the admin section. I guess my question is how to ammend it so it functions in the sidebar.

    Any other ideas?


  11. skippy
    Posted 11 years ago #

    fetch_rss() is defined in /wp-includes/rss-functions.php, which I don't think is loaded for the main blog display.

    You could try
    include_once(ABSPATH . 'wp-includes/rss-functions.php');
    in your index.php (or sidebar.php) and then see if fetch_rss() works.

  12. piginzen
    Posted 11 years ago #

    I tried putting that include for the rss-functions.php in my header at the top...

    I am still getting nothing... not even an error...

    I even tried:
    <?php require_once (ABSPATH . WPINC . '/rss-functions.php'); ?>

    Thanks so much for all your patience...

  13. skippy
    Posted 11 years ago #

    I just applied that code to my test site's sidebar, using my real blog in the Technorati query. Nothing happened. So I looked at my real blog's dashboard and saw no incoming links.

    The technorati query does show inbound links for my blog:

    It may be that Technorati changed their API a bit? I don't know. I've never paid much attention to Technorati...

  14. skippy
    Posted 11 years ago #

    Incidentally, the code is working, it's just not getting an array of items to iterate over. If you die(print_r($rss)); after you fetch the items, you'll see that the $rss variable does contain data. It's just not the data you were expecting.

  15. piginzen
    Posted 11 years ago #

    It is interesting why nothing is showing in my dashboard... I didnt even notice it! It used to show... But I did move my domains around recently... so maybe it will just take time to propagate...

    Just weird that it shows on technorati's site and not the dashboard...

Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.