Follow along with the video below to see how to install our site as a web app on your home screen.
Anmerkung: This feature may not be available in some browsers.
<?php get_header(); ?>
<div class="block">
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
[B]<?php
//index.php
include('config.php');
if(isset($_GET['section']) AND isset($dateien[$_GET['section']]))
{
//Ist eine $_GET Variable vorhanden wird PHP angewiesen
//zu prüfen ob die Datei existiert und diese dann zu laden
if(!file_exists($dateien[$_GET['section']])) echo "";
include $dateien[$_GET['section']];
}
else
{
//Wenn keine Variable oder Definition vorhanden ist
//lade die Fehlerseite bzw. die Indexseite
include $dateien['first'];
}
?> [/B]
<br>
<?php endwhile; ?>
<?php else : ?>
<?php endif; ?>
<?php get_footer(); ?>
und dann config.php
<?php
//config.php
$dateien = array(); //Erstellt einen neuen Array $dateien
$dateien['first'] = "first.php"; //für jede Section ein neue Variable
$dateien['media'] = "media.php"; //usw.
$dateien['site'] = "site.php";
$dateien['error'] = "first.php";
$dateien['show'] = "show.php";
$dateien['fan'] = "fan.php";
?>
<?php get_header(); ?>
<div class="block">
<?php
/**
* Dein Code
*/
include ('config.php');
if (isset($_GET['section']) && isset($dateien[$_GET['section']])) {
if(file_exists($dateien[$_GET['section']])) {
include ($dateien[$_GET['section']]);
} else {
include ($dateien['first']);
}
}
/**
* Die Posts
*/
if (have_posts()) {
while (have_posts()) {
the_post();
?>
<br>
<?php
}
} else {
?>
<?php
}
?>
<?php get_footer(); ?>