WordPress.org

Ready to get started?Download WordPress

Forums

[Plugin: LeagueManager] Problem displaying matches manually in theme (10 posts)

  1. Misus
    Member
    Posted 5 years ago #

    I'm experiencing som problems displaying matches manually in one of my theme files. Here's the piece of code I've added to the theme.

    <?php leaguemanager_matches(1, mode='home') ?>

    It makes the whole screen white. Anybody got an idea what's going on and can point me in the right direction?

  2. Kolja
    Member
    Posted 5 years ago #

    The function call is not correct. I've made some small changes to the function calls, so upgrade to 3.0.2 and then do this:

    <?php leaguemanager_matches( 1, array( 'mode' => 'home' ) ); ?>

  3. Misus
    Member
    Posted 5 years ago #

    Thanks,
    And how would I add a custom template?

  4. Misus
    Member
    Posted 5 years ago #

    I mean how would I reference a custom template in that code?
    <?php leaguemanager_matches( 1, array( 'mode' => 'home', 'template' => 'myTemplate') ); ?> ????

  5. Kolja
    Member
    Posted 5 years ago #

    Custom templates need to be put in

    your_theme_dir/leaguemanager/

    the templates need to be named as follows

    standings-$template.php
    matches-$template.php
    match-$template.php
    teams-$template.php
    team-$template.php
    crosstable-$template.php

    So with your code the template's name would have to be matches-myTemplate.php

  6. Misus
    Member
    Posted 5 years ago #

    Yea I allready have a template named matches-future.php in my_theme_dir/leaguemanager/. It's a slightly modified version of the matches template.

    I guess my question is how I can use the template in the following code:
    <?php leaguemanager_matches( 1, array( 'mode' => 'home' ) ); ?>

  7. Kolja
    Member
    Posted 5 years ago #

    <?php leaguemanager_matches( 1, arraz('mode' => 'home', 'template' => 'future') ) ?>

  8. Misus
    Member
    Posted 5 years ago #

    For some reason it's not working. It's not using my custom template. Here's what I've done.

    1. I've copied the matches.php file into my_theme_dir/leaguemanager/ and renamed it matches-future.php
    2. I've modified the file slightly (deleted the first row from the table)
    3. I've added the following code to one of my templates:
    <?php leaguemanager_matches( 1, array('mode' => 'home', 'template' => 'future') ) ?>

    It works if I use short code but not manually in the template. I don't have wp installed in my root directory (it's in root/wordpress) could that have anything to do with it?

  9. Misus
    Member
    Posted 5 years ago #

    Ok i've managed to locate the problem I think. In your functions.php the leaguemanager_matches function is missing 'template' => $template from the echo $lmShortcodes->showMatches. Thought you might wanna know that.

  10. Kolja
    Member
    Posted 5 years ago #

    Fixed that

Topic Closed

This topic has been closed to new replies.

About this Topic