mirror of
https://github.com/ascribe/wp-theme
synced 2024-12-22 17:23:55 +01:00
Subtemplate building
This commit is contained in:
parent
648ab120f0
commit
8300478ef7
@ -13,13 +13,15 @@ class Subtemplate {
|
||||
$id = $post->ID;
|
||||
$result = '';
|
||||
|
||||
$subtemplates = get_field('subtemplate', $id);
|
||||
$result = '';
|
||||
if( $subtemplates ) {
|
||||
foreach ( $subtemplates as $subtemplate ) {
|
||||
$subtemplateType = $subtemplate['subtemplate_type'];
|
||||
if (have_rows('subtemplate',$id)) {
|
||||
while (have_rows('subtemplate',$id)) {
|
||||
the_row();
|
||||
|
||||
$subtemplateTitle = $subtemplate['section_title'];
|
||||
$subtemplateType = get_sub_field('subtemplate_type');
|
||||
|
||||
$subtemplateTitle = get_sub_field('section_title');
|
||||
|
||||
$subtemplate = '';
|
||||
|
||||
switch ($subtemplateType) {
|
||||
case 'featurecircles':
|
||||
@ -52,68 +54,95 @@ class Subtemplate {
|
||||
case 'team':
|
||||
$result .= $this->team($subtemplate,$subtemplateTitle);
|
||||
break;
|
||||
|
||||
|
||||
case 'content':
|
||||
$result .= $this->content($subtemplate,$subtemplateTitle);
|
||||
break;
|
||||
case 'faq':
|
||||
$result .= $this->faq($subtemplate,$subtemplateTitle);
|
||||
break;
|
||||
case 'careers':
|
||||
$result .= $this->careers($subtemplate,$subtemplateTitle);
|
||||
break;
|
||||
case 'mediadetail':
|
||||
$result .= $this->mediaDetail($subtemplate,$subtemplateTitle);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
public function featureCircles($subtemplate,$subtemplateTitle) {
|
||||
$result = '';
|
||||
|
||||
return result;
|
||||
return $result;
|
||||
}
|
||||
public function caseStudies($subtemplate,$subtemplateTitle) {
|
||||
$result = '';
|
||||
|
||||
return result;
|
||||
return $result;
|
||||
}
|
||||
public function oldNew($subtemplate,$subtemplateTitle) {
|
||||
$result = '';
|
||||
|
||||
return result;
|
||||
return $result;
|
||||
}
|
||||
public function productOverview($subtemplate,$subtemplateTitle) {
|
||||
$result = '';
|
||||
|
||||
return result;
|
||||
return $result;
|
||||
}
|
||||
public function blueBox($subtemplate,$subtemplateTitle) {
|
||||
$result = '';
|
||||
|
||||
return result;
|
||||
return $result;
|
||||
}
|
||||
public function createAccount($subtemplate,$subtemplateTitle) {
|
||||
$result = '';
|
||||
|
||||
return result;
|
||||
return $result;
|
||||
}
|
||||
public function galleries($subtemplate,$subtemplateTitle) {
|
||||
$result = '';
|
||||
|
||||
return result;
|
||||
return $result;
|
||||
}
|
||||
public function blogFeatures($subtemplate,$subtemplateTitle) {
|
||||
$result = '';
|
||||
|
||||
return result;
|
||||
return $result;
|
||||
}
|
||||
public function mediaFeature($subtemplate,$subtemplateTitle) {
|
||||
$result = '';
|
||||
|
||||
return result;
|
||||
return $result;
|
||||
}
|
||||
public function team($subtemplate,$subtemplateTitle) {
|
||||
$result = '';
|
||||
|
||||
return result;
|
||||
return $result;
|
||||
}
|
||||
public function content($subtemplate,$subtemplateTitle) {
|
||||
$result = '';
|
||||
|
||||
$result .= get_sub_field('content');
|
||||
|
||||
return $result;
|
||||
}
|
||||
public function faq($subtemplate,$subtemplateTitle) {
|
||||
$result = '';
|
||||
|
||||
return $result;
|
||||
}
|
||||
public function careers($subtemplate,$subtemplateTitle) {
|
||||
$result = '';
|
||||
|
||||
return $result;
|
||||
}
|
||||
public function mediaDetail($subtemplate,$subtemplateTitle) {
|
||||
$result = '';
|
||||
|
||||
return $result;
|
||||
}
|
||||
}
|
@ -38,9 +38,9 @@ remove_action( 'wp_head', 'print_emoji_detection_script', 7 );
|
||||
remove_action( 'admin_print_scripts', 'print_emoji_detection_script' );
|
||||
remove_action( 'wp_print_styles', 'print_emoji_styles' );
|
||||
remove_action( 'admin_print_styles', 'print_emoji_styles' );
|
||||
|
||||
//ACF Collapser temp fix
|
||||
add_filter('acf/compatibility/field_wrapper_class', '__return_true');
|
||||
//
|
||||
////ACF Collapser temp fix
|
||||
//add_filter('acf/compatibility/field_wrapper_class', '__return_true');
|
||||
|
||||
// TURN ON ACF SETTINGS PAGE
|
||||
if( function_exists('acf_add_options_page') ) {
|
||||
@ -62,7 +62,7 @@ add_action( 'init', 'wpcodex_add_excerpt_support_for_pages' );
|
||||
|
||||
//Register Navigation
|
||||
function register_primary_nav_menu() {
|
||||
register_nav_menu('header-menu',__( 'Primary Navigation Menu' ));
|
||||
register_nav_menu('research-menu',__( 'Research Areas Menu' ));
|
||||
register_nav_menu('landing-menu',__( 'Product Tour Navigation Menu' ));
|
||||
register_nav_menu('general-menu',__( 'General Page Navigation Menu' ));
|
||||
}
|
||||
add_action( 'init', 'register_primary_nav_menu');
|
5
template-events.php
Normal file
5
template-events.php
Normal file
@ -0,0 +1,5 @@
|
||||
<?php
|
||||
/*
|
||||
Template Name: Events
|
||||
*/
|
||||
require 'template.php';
|
5
template-general.php
Normal file
5
template-general.php
Normal file
@ -0,0 +1,5 @@
|
||||
<?php
|
||||
/*
|
||||
Template Name: General Content Page
|
||||
*/
|
||||
require 'template.php';
|
@ -11,11 +11,11 @@ $controller = new Controller();
|
||||
<?php echo $logo; ?>
|
||||
<nav>
|
||||
<span class="icon-menu mobile-only"></span>
|
||||
<?php wp_nav_menu( array( 'theme_location' => 'header-menu', 'container' => false ) ); ?>
|
||||
<?php wp_nav_menu( array( 'theme_location' => 'landing-menu', 'container' => false ) ); ?>
|
||||
</nav>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<?php get_template_part( 'content', 'main' ); ?>
|
||||
<?php require 'content-main.php'; ?>
|
||||
|
||||
<?php get_footer(); ?>
|
24
template.php
Normal file
24
template.php
Normal file
@ -0,0 +1,24 @@
|
||||
<?php
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: sarahetter
|
||||
* Date: 15-09-18
|
||||
* Time: 4:33 PM
|
||||
*/
|
||||
get_header();
|
||||
$controller = new Controller();
|
||||
?>
|
||||
|
||||
<header>
|
||||
<div class="centered">
|
||||
<?php echo $logo; ?>
|
||||
<nav>
|
||||
<span class="icon-menu mobile-only"></span>
|
||||
<?php wp_nav_menu( array( 'theme_location' => 'general-menu', 'container' => false ) ); ?>
|
||||
</nav>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<?php get_template_part( 'content', 'main' ); ?>
|
||||
|
||||
<?php get_footer(); ?>
|
Loading…
Reference in New Issue
Block a user