K
(@koelle)
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’ ) ); ?>
Thread Starter
misus
(@misus)
Thanks,
And how would I add a custom template?
Thread Starter
misus
(@misus)
I mean how would I reference a custom template in that code?
<?php leaguemanager_matches( 1, array( ‘mode’ => ‘home’, ‘template’ => ‘myTemplate’) ); ?> ????
K
(@koelle)
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
Thread Starter
misus
(@misus)
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’ ) ); ?>
K
(@koelle)
<?php leaguemanager_matches( 1, arraz('mode' => 'home', 'template' => 'future') ) ?>
Thread Starter
misus
(@misus)
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?
Thread Starter
misus
(@misus)
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.