Support » Plugin: Right Now Reloaded » [Plugin: Right Now Reloaded] Customize the post types

  • Resolved mamouneyya



    Working with clients, I sometimes need to hide some post types stats from the widget that I don’t want the client to play with or get confused by. Since the plugin doesn’t provide a configuration options of any kind, I came to a simple CSS solution using display: none. However, since the< li > tags don’t have ids, I had to hide the inside < a > elements directly using their href attributes, something like:

    #md-rnr-content a[href="widgets.php"],
    #md-rnr-content a[href="upload.php"] {
      display: none;

    The problem using this way is that, since we don’t hide the < li > elements themselves, they keep shown as an empty space:

    A simple solution that would help, in case you don’t want to go with configuration options complexcity, is to add id attributes to the < li > tags.

    I would appreciate an update for this.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Michael Dance


    3 options for this:

    Only CSS

    Using the ‘+’ operator to pick adjacent elements would work. For example to erase the third post type listed, you’d add:

    #md-rnr-content tr + tr + tr {

    This has the side effect of making every post type after the third disappear as well, so you’d have to then add:

    #md-rnr-content tr + tr + tr + tr {

    …to get them to show up again. And that, it turn, has the side effect of not working in IE7 or less.

    PHP and CSS

    You can add classes to the plugin manually by sifting through right-now-reloaded.php. Here’s where:

    Change line 243 to:
    $output[$post_amount] .= '<tr class="rnr-' . $type->name . '-row">';

    Change line 277 to:
    $output[$link_amount] .= '<tr class="rnr-link-row">';

    Change line 303 to:
    $output[$comment_amount] .= '<tr class="rnr-comment-row">';

    Change line 333 to:
    $output[$widget_amount] .= '<tr class="rnr-widget-row">';

    Custom Post Types

    By default only post types with 'public' => true show up in the list. So when registering them you could set them to 'public' => false, though that will have plenty of other ramifications and might not be doable in your case.

    At some point I will probably release a new version to tighten up the code, and when I do I will definitely include classes for rows. Thanks for the heads-up.


    I don’t like the CSS workaround because it is unreliable to depend on the order in my opinion.. something could be changed later. #3 is also out for me because I need to hide some WP default post types which I have no control with.

    About #2, I actually thought of it but I did’t like the idea of directly editing the plugin files, since that would make upgrading harder in the future. However, since the new version will come with a solution, it isn’t a bad idea..

    I think I will go with #2 for now. Thanks for taking the time, Michael!

    PS That doesn’t include the taxonomies, which I also need to hide some of them:
    $output[$taxonomy_amount] .= '<tr class="rnr-' . $taxonomy->label . '-row">';

    $output[$link_category_amount] .= '<tr class="rnr-linkcat-row">';
    $output[$active_menu_count] .= '<tr class="rnr-menu-row">';

    would be nice if you included them also, if you ever update the plugin.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Plugin: Right Now Reloaded] Customize the post types’ is closed to new replies.