add proper links to the speakers page

This commit is contained in:
Vasil Kolev 2015-10-19 21:14:48 +03:00 committed by Openfest
parent 7fd8c66edd
commit 463be5995a
2 changed files with 28 additions and 2 deletions

View File

@ -1,6 +1,32 @@
<?php <?php
/* Template Name: Schedule */ /* Template Name: Schedule */
get_header(); get_header();
$lang = pll_current_language('slug');
/*
* There is no better way to get where the speakers are
*/
if ('en' === $lang) {
$s_slug = 'speakers';
} else {
$s_slug = 'lektori';
}
$args = array(
'name' => $s_slug,
'post_type' => 'page',
'numberposts' => 1
);
$url = '';
$my_posts = get_posts($args);
if( $my_posts ) {
$url = get_permalink( $my_posts[0]->ID );
}
$content = require __DIR__ . DIRECTORY_SEPARATOR . 'schedule' . DIRECTORY_SEPARATOR . 'parse.php'; $content = require __DIR__ . DIRECTORY_SEPARATOR . 'schedule' . DIRECTORY_SEPARATOR . 'parse.php';
//var_dump($data); //var_dump($data);
?> ?>
@ -25,7 +51,7 @@ $content = require __DIR__ . DIRECTORY_SEPARATOR . 'schedule' . DIRECTORY_SEPARA
<tbody> <tbody>
<?php <?php
foreach ($content['lines'] as $line) { foreach ($content['lines'] as $line) {
echo $line, PHP_EOL; echo str_replace('SPKURL', $url, $line), PHP_EOL;
} }
?> ?>
</tbody> </tbody>

View File

@ -67,7 +67,7 @@ foreach ($data['slots'] as $slot_id => $slot) {
} else { } else {
/* TODO: fix the URL */ /* TODO: fix the URL */
$name = $data['speakers'][$uid]['first_name'] . ' ' . $data['speakers'][$uid]['last_name']; $name = $data['speakers'][$uid]['first_name'] . ' ' . $data['speakers'][$uid]['last_name'];
$spk[$uid] = '<a class="vt-p" href="#'. $name . '">' . $name . '</a>'; $spk[$uid] = '<a class="vt-p" href="SPKURL#'. $name . '">' . $name . '</a>';
} }
} }
$speakers = implode (', ', $spk); $speakers = implode (', ', $spk);