Forums

Rift Shard Status
[resolved] Show widget on homepage (9 posts)

  1. dannykilla
    Member
    Posted 1 year ago #

    Hi,

    I have installed your widget thinking that the Widget Context would be able to show it on my frontpage, this however didnt work.

    I use the theme Wisebusiness and I have slightly changed the way the theme works, as it has its own homepage widgets, which I have removed.

    So basically, is there a simple way of getting this to show on the homepage as this is the only location I wish to have this viewable.

    Thanks

    http://wordpress.org/extend/plugins/rift-shard-status/

  2. jakob42
    Member
    Posted 1 year ago #

    The Widget can be shown everywhere in your theme where it defines a space for widgets.

    But I'm not sure what it is you would like to see. Do you want a php function to integrate directly in you theme? Or a shortcode?

  3. dannykilla
    Member
    Posted 1 year ago #

    Basically, the Homepage of my site doesnt use the normal widgets function, so a shortcode that would allow me to place that code in the home.php file would be great, if thats possible.

    Thanks

  4. jakob42
    Member
    Posted 1 year ago #

    I didn't had time to test it somewhere, but the following lines of code should work:

    $instance = array();
    $instance['shard'] = "yourShard";
    $instance['region'] = "eu"; // or "us"
    $instance['cache_time'] = 300 // in seconds
    $instance['show_last_update'] = true; // or false...
    echo(rift_shard_status_html($instance));
  5. dannykilla
    Member
    Posted 1 year ago #

    Hi Jakob,

    Thanks for the reply, I pasted the code above with the change to my Shard and when I refresh my homepage all I can see is the code itself, like it is above?

    Is there something else I should have done?

    Thanks
    Dan

  6. jakob42
    Member
    Posted 1 year ago #

    This is PHP code, therefore it needs to be in an php environment. The following should work:

    <?php
    THE_CODE
    ?>
  7. dannykilla
    Member
    Posted 1 year ago #

    thanks for the reply,

    I actually tried that and get the following error when I refresh the page:

    Parse error: syntax error, unexpected T_VARIABLE

    Thanks

  8. jakob42
    Member
    Posted 1 year ago #

    Well, there was a semicolon missing and I added a <div> to make sure the plugin uses its stylesheet:

    <div class="riftss">
    <?php
    $instance = array();
    $instance['shard'] = "yourshard";
    $instance['region'] = "eu"; // or "us"
    $instance['cache_time'] = 300; // in seconds
    $instance['show_last_update'] = true; // or false...
    echo(rift_shard_status_html($instance));
    ?>
    </div>
  9. dannykilla
    Member
    Posted 1 year ago #

    Awesome thanks!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic