<?php $KKL = new KKL(); $db = new KKL_DB(); $currentGameDay = $db->getCurrentGameDayForLeague(1); /* Template Name: Spieltag Übersicht */ get_header(); ?> <section class="kkl-content"> <div class="container"> <div class="row"> <div class="col-sm-10 col-md-8 col-sm-offset-1 col-md-offset-2"> <?php if (have_posts()) { while (have_posts()) { the_post(); ?> <article id="post-<?php the_ID(); ?> " <?php post_class(); ?> > <header class="text-center"> <small class="entry-metadata">
function get_current_game_day() { if ($this->currentGameDay) { return $this->currentGameDay; } $day = null; $db = new KKL_DB(); if ($_GET['game_day_filter']) { $day = $db->getGameday($_GET['game_day_filter']); } elseif ($this->get_current_season()) { $day = $db->getCurrentGameDayForSeason($this->get_current_season()->id); } elseif ($this->get_current_league()) { $day = $db->getCurrentGameDayForLeague($this->get_current_league()->id); } $this->currentGameDay = $day; return $day; }