Support » Fixing WordPress » Dashboard stats in my sidebar

  • 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?

Viewing 14 replies - 1 through 14 (of 14 total)
  • Why not go into wp-admin/index.php (i.e. the Dashboard file) and copy the code sections you want?

    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.

    “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.

    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.


    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…

    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?

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

    and i’ve tried this code with no luck:
    $rss = @fetch_rss(''. 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 } ?>

    Moderator James Huff


    Volunteer Moderator 🚀

    Try one of the recent Statistics plugins:


    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?





    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.

    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…




    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…




    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.

    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…

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘Dashboard stats in my sidebar’ is closed to new replies.