yes, thx
Example for others:
Add a Primary League and after that add sub parent to it like
Group A, Group B
here is my code to display on a template page all Group teams like
Group A
team name 1
team name 2 etc.
<?php
/**
* The template for displaying the Groupe Teams.
*
* Template Name: Grupe
*
* @package Rookie
*/
get_header(); ?>
<div id="primary" class="content-area">
<main id="main" class="site-main" role="main">
<?php
$table_name = $wpdb->prefix . "term_taxonomy";
$sql = "SELECT term_id FROM " . $table_name . " where parent!='0'";
$pageposts = $wpdb->get_results($sql);
foreach ( $pageposts as $pagepost)
{
$table_name = $wpdb->prefix . "terms";
$sql = "SELECT name FROM " . $table_name . " where term_id='".$pagepost->term_id."'";
$ageposts = $wpdb->get_results($sql);
foreach ( $ageposts as $agepost)
{
echo '<h4 class="sp-table-caption">'.$agepost->name.'</h4>';
}
echo '<table class="sp-data-table">';
$table_name = $wpdb->prefix . "term_relationships";
$sql = "SELECT object_id FROM " . $table_name . " where term_taxonomy_id='".$pagepost->term_id."'";
$echipe = $wpdb->get_results($sql);
foreach ( $echipe as $echipa)
{
$table_name = $wpdb->prefix . "posts";
$sql = "SELECT post_title FROM " . $table_name . " where id='".$echipa->object_id."'";
$nechipe = $wpdb->get_results($sql);
foreach ( $nechipe as $nechipa)
{
echo '<tr><td>'.$nechipa->post_title.'</td></tr>';
}
}
echo '</table>';
}
?>
</main><!-- #main -->
</div><!-- #primary -->
<?php get_sidebar(); ?>
<?php get_footer(); ?>