• Hi I have a gamesite where I have a game list using wp-table-reloaded. Pls check: https://www.pvp-gaming.com/game-list/

    Now I’m using ‘Rating widget plugin’ where visitors can rate games in the game list. Now I want that voting results to show on the ‘rating’ field instead of N/A for each game. How I do that is that I need to put in some codes where the N/A is:

    <?php
        $link = get_permalink($post->ID);      // game url
        $urid = ($post->ID + 1) . "0";              // user-rating-id
        $post_title = $post->post_title;         // game title
    ?>
    <a>">
          <?php echo $this->rw_embed_rating($urid, $post_title, "blog-post", $link);?>
    </a>

    [Please post code snippets between backticks or use the code button.]

    Now where do I find the .php page for that gamelist? I cannot seem to find it ??

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    this won’t really work that easily.
    The problem is that this code is designed to be used in a WordPress Loop, which returns the post ID, which you can then use in this code to load the rating from the database.

    Now, you could do this manually, without the Loop, with the following idea: Define a WordPress Shortcode for this code, that takes the post ID as a parameter. You would then need to manually adjust that parameter for each game in it’s row in the table.
    With the code you already have, this is only a small plugin.

    Regards,
    Tobias

    Thread Starter Benskh081

    (@benskh081)

    I mean that I cant find the wp-table-reloaded there i can put those code in that specific table.

    Thread Starter Benskh081

    (@benskh081)

    ok, so just need to define that with a shortcode. Are u suggesting me contacting the rating dev. or is there just a plugin for that?

    Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    the tables in WP-Table Reloaded don’t work with files, thus, you won’t find one to add this code to. Tables are stored in the database, and even there you can’t add the code, as it won’t be executed.

    I’m suggesting that you develop a small plugin that wraps this code in a Shortcode. This plugin does not yet exist, it has to be written first.
    You could then use the Shortcode in the table, instead of the “N/A”. When the table is then shown, the Shortcode executes the PHP code and shows the rating.

    Regards,
    Tobias

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Trying to add some’ is closed to new replies.