mirror of
https://github.com/ascribe/wp-theme
synced 2024-12-22 09:13:38 +01:00
Subtemplate building
This commit is contained in:
parent
648ab120f0
commit
8300478ef7
@ -13,13 +13,15 @@ class Subtemplate {
|
|||||||
$id = $post->ID;
|
$id = $post->ID;
|
||||||
$result = '';
|
$result = '';
|
||||||
|
|
||||||
$subtemplates = get_field('subtemplate', $id);
|
if (have_rows('subtemplate',$id)) {
|
||||||
$result = '';
|
while (have_rows('subtemplate',$id)) {
|
||||||
if( $subtemplates ) {
|
the_row();
|
||||||
foreach ( $subtemplates as $subtemplate ) {
|
|
||||||
$subtemplateType = $subtemplate['subtemplate_type'];
|
|
||||||
|
|
||||||
$subtemplateTitle = $subtemplate['section_title'];
|
$subtemplateType = get_sub_field('subtemplate_type');
|
||||||
|
|
||||||
|
$subtemplateTitle = get_sub_field('section_title');
|
||||||
|
|
||||||
|
$subtemplate = '';
|
||||||
|
|
||||||
switch ($subtemplateType) {
|
switch ($subtemplateType) {
|
||||||
case 'featurecircles':
|
case 'featurecircles':
|
||||||
@ -52,68 +54,95 @@ class Subtemplate {
|
|||||||
case 'team':
|
case 'team':
|
||||||
$result .= $this->team($subtemplate,$subtemplateTitle);
|
$result .= $this->team($subtemplate,$subtemplateTitle);
|
||||||
break;
|
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;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function featureCircles($subtemplate,$subtemplateTitle) {
|
public function featureCircles($subtemplate,$subtemplateTitle) {
|
||||||
$result = '';
|
$result = '';
|
||||||
|
|
||||||
return result;
|
return $result;
|
||||||
}
|
}
|
||||||
public function caseStudies($subtemplate,$subtemplateTitle) {
|
public function caseStudies($subtemplate,$subtemplateTitle) {
|
||||||
$result = '';
|
$result = '';
|
||||||
|
|
||||||
return result;
|
return $result;
|
||||||
}
|
}
|
||||||
public function oldNew($subtemplate,$subtemplateTitle) {
|
public function oldNew($subtemplate,$subtemplateTitle) {
|
||||||
$result = '';
|
$result = '';
|
||||||
|
|
||||||
return result;
|
return $result;
|
||||||
}
|
}
|
||||||
public function productOverview($subtemplate,$subtemplateTitle) {
|
public function productOverview($subtemplate,$subtemplateTitle) {
|
||||||
$result = '';
|
$result = '';
|
||||||
|
|
||||||
return result;
|
return $result;
|
||||||
}
|
}
|
||||||
public function blueBox($subtemplate,$subtemplateTitle) {
|
public function blueBox($subtemplate,$subtemplateTitle) {
|
||||||
$result = '';
|
$result = '';
|
||||||
|
|
||||||
return result;
|
return $result;
|
||||||
}
|
}
|
||||||
public function createAccount($subtemplate,$subtemplateTitle) {
|
public function createAccount($subtemplate,$subtemplateTitle) {
|
||||||
$result = '';
|
$result = '';
|
||||||
|
|
||||||
return result;
|
return $result;
|
||||||
}
|
}
|
||||||
public function galleries($subtemplate,$subtemplateTitle) {
|
public function galleries($subtemplate,$subtemplateTitle) {
|
||||||
$result = '';
|
$result = '';
|
||||||
|
|
||||||
return result;
|
return $result;
|
||||||
}
|
}
|
||||||
public function blogFeatures($subtemplate,$subtemplateTitle) {
|
public function blogFeatures($subtemplate,$subtemplateTitle) {
|
||||||
$result = '';
|
$result = '';
|
||||||
|
|
||||||
return result;
|
return $result;
|
||||||
}
|
}
|
||||||
public function mediaFeature($subtemplate,$subtemplateTitle) {
|
public function mediaFeature($subtemplate,$subtemplateTitle) {
|
||||||
$result = '';
|
$result = '';
|
||||||
|
|
||||||
return result;
|
return $result;
|
||||||
}
|
}
|
||||||
public function team($subtemplate,$subtemplateTitle) {
|
public function team($subtemplate,$subtemplateTitle) {
|
||||||
$result = '';
|
$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( 'admin_print_scripts', 'print_emoji_detection_script' );
|
||||||
remove_action( 'wp_print_styles', 'print_emoji_styles' );
|
remove_action( 'wp_print_styles', 'print_emoji_styles' );
|
||||||
remove_action( 'admin_print_styles', 'print_emoji_styles' );
|
remove_action( 'admin_print_styles', 'print_emoji_styles' );
|
||||||
|
//
|
||||||
//ACF Collapser temp fix
|
////ACF Collapser temp fix
|
||||||
add_filter('acf/compatibility/field_wrapper_class', '__return_true');
|
//add_filter('acf/compatibility/field_wrapper_class', '__return_true');
|
||||||
|
|
||||||
// TURN ON ACF SETTINGS PAGE
|
// TURN ON ACF SETTINGS PAGE
|
||||||
if( function_exists('acf_add_options_page') ) {
|
if( function_exists('acf_add_options_page') ) {
|
||||||
@ -62,7 +62,7 @@ add_action( 'init', 'wpcodex_add_excerpt_support_for_pages' );
|
|||||||
|
|
||||||
//Register Navigation
|
//Register Navigation
|
||||||
function register_primary_nav_menu() {
|
function register_primary_nav_menu() {
|
||||||
register_nav_menu('header-menu',__( 'Primary Navigation Menu' ));
|
register_nav_menu('landing-menu',__( 'Product Tour Navigation Menu' ));
|
||||||
register_nav_menu('research-menu',__( 'Research Areas Menu' ));
|
register_nav_menu('general-menu',__( 'General Page Navigation Menu' ));
|
||||||
}
|
}
|
||||||
add_action( 'init', 'register_primary_nav_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; ?>
|
<?php echo $logo; ?>
|
||||||
<nav>
|
<nav>
|
||||||
<span class="icon-menu mobile-only"></span>
|
<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>
|
</nav>
|
||||||
</div>
|
</div>
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
<?php get_template_part( 'content', 'main' ); ?>
|
<?php require 'content-main.php'; ?>
|
||||||
|
|
||||||
<?php get_footer(); ?>
|
<?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