+ $result = "
+
+
{$subtemplateTitle}
-
{$content}
-
{$teamMemberMarkup}
-
-
- ";
-
- return $result;
- }
- public function content($subtemplateTitle) {
-
- $content = get_sub_field('content');
-
- $bgColor = get_sub_field('background_color');
-
- $result = "
-
-
-
{$subtemplateTitle}
-
{$content}
-
-
- ";
-
- return $result;
- }
- public function contentBoxed($subtemplateTitle) {
-
- $content = get_sub_field('content');
-
- $result = "
-
-
-
{$subtemplateTitle}
-
{$content}
-
-
- ";
-
- return $result;
- }
- public function image($subtemplateTitle) {
-
- $image = get_sub_field('image')['url'];
- $imageAlt = get_sub_field('image')['alt'];
-
- $result = "
-
-
-
{$subtemplateTitle}
-
-
-
- ";
-
- return $result;
- }
- public function faq($subtemplateTitle) {
- $featuredFAQ = '
';
- if (have_rows('featured_faqs')) {
- while (have_rows('featured_faqs')) {
- the_row();
-
- $question = get_sub_field('question');
- $answer = get_sub_field('answer');
-
- $featuredFAQ .= "- {$question}
- - {$answer}
";
- }
- }
- $featuredFAQ .= "
";
-
- $regularFAQ = '
';
- if (have_rows('regular_faqs')) {
- while (have_rows('regular_faqs')) {
- the_row();
-
- $question = get_sub_field('question');
- $answer = get_sub_field('answer');
-
- $regularFAQ .= "- Q: {$question}
- - A: {$answer}
";
- }
- }
- $regularFAQ .= "
";
-
- $result = "
-
-
-
{$subtemplateTitle}
- {$featuredFAQ}
- {$regularFAQ}
-
-
- ";
-
- return $result;
- }
- public function values($subtemplateTitle) {
- $values = '';
- if (have_rows('ascribe_values')) {
- while (have_rows('ascribe_values')) {
- the_row();
-
- $title = get_sub_field('value_title');
- $description = get_sub_field('value_description');
-
- $values .= "
- {$title}
- {$description}
- ";
- }
- }
-
- $result = "
-
{$subtemplateTitle}
-
{$values}
-
";
-
- return $result;
- }
- public function careers($subtemplateTitle) {
- $args = array(
- 'post_type' => 'career',
- 'order' => 'ASC'
- );
-
- $careers = get_posts($args);
- $careerMarkup = '';
- if (!empty($careers)) {
- foreach ($careers as $career) {
- $id = $career->ID;
- $name = $career->post_title;
- $url = get_permalink($id);
-
- $careerMarkup .= "
{$name}";
- }
- }
-
- $result = "
-
-
{$subtemplateTitle}
-
-
- ";
-
- return $result;
- }
- public function mediaDetail($subtemplateTitle) {
- $image = get_sub_field('image')['url'];
-
- $args = array(
- 'post_type' => 'presscoverage',
- 'order' => 'ASC',
- 'posts_per_page' => 50
- );
-
-
- $pressItems = get_posts($args);
- $pressMarkup = '';
- if (!empty($pressItems)) {
- foreach ($pressItems as $item) {
- $id = $item->ID;
- $name = $item->post_title;
- $url = get_field('link_to_article',$id);
- $pubDate= get_field('date_published',$id);
- $quote = get_field('quote',$id);
-
- $pressMarkup .= "
-
-
- {$quote}
- ";
- }
- }
-
- $result = "
-
-
-
{$subtemplateTitle}
-
-
{$pressMarkup}
-
-
-
- ";
-
- return $result;
- }
- public function download($subtemplateTitle) {
- $leftUrl = get_sub_field('left_button_url');
- $leftText = get_sub_field('left_button_text');
- $rightUrl = get_sub_field('right_button_url');
- $rightText = get_sub_field('right_button_text');
-
- $result = "
";
-
- return $result;
- }
- public function contactPage($subtemplateTitle) {
- $contactPoints = '';
-
- $content = get_sub_field('content');
-
- if (have_rows('contact_point')) {
- while (have_rows('contact_point')) {
- the_row();
-
- $title = get_sub_field('contact_description');
- $contactInfo = make_clickable(get_sub_field('contact_details'));
-
- $contactPoints .= "
- {$title}
- {$contactInfo}
- ";
- }
- }
-
- $result = "
";
-
- return $result;
- }
- public function eventPage($subtemplateTitle) {
-
- $datePage = get_query_var('date');
-
- if (empty($datePage)) {
- return $this->mainEventPage($subtemplateTitle);
- }
- else {
-
- if (!preg_match('/2\d{7}$|all/',$datePage)) {
- return $this->mainEventPage($subtemplateTitle);
- }
-
- $args = '';
- if ($datePage === 'all') {
- $args = array(
- 'post_type' => 'event',
- 'order' => 'DESC',
- 'orderby' => 'meta_value',
- 'meta_key' => 'date',
- 'posts_per_page' => -1
- );
- }
- else {
- $firstOfMonth = DateTime::createFromFormat('Ymd',$datePage);
- $month = $firstOfMonth->format('m');
- $year = $firstOfMonth->format('Y');
- $daysInMonth = cal_days_in_month(CAL_GREGORIAN,$month,$year);
- $startDate = $year.$month.'01';
- $endDate = $year.$month.$daysInMonth;
-
- $args = array(
- 'post_type' => 'event',
- 'order' => 'ASC',
- 'orderby' => 'meta_value',
- 'meta_key' => 'date',
- 'posts_per_page' => -1,
- 'meta_query' => array(
- array(
- 'key' => 'date',
- 'value' => $startDate,
- 'compare' => '>=',
- ),
- array(
- 'key' => 'date',
- 'value' => $endDate,
- 'compare' => '<='
- )
- )
- );
- }
-
-
-
- $events = get_posts($args);
- $eventMarkup = '';
- $dateInLoop = '';
- $lastDate = '';
- if (!empty($events)) {
- foreach ($events as $item) {
- $id = $item->ID;
- $name = $item->post_title;
- $url = get_field('link_to_event',$id);
- $pubDate= get_field('date',$id);
- $quote = get_field('description',$id);
-
- $dateInLoop = date_create_from_format('F j, Y', $pubDate);
- $dateInLoop = date_format($dateInLoop, 'F Y');
- $header = '';
- if ($dateInLoop !== $lastDate) {
- $header = "
{$dateInLoop}
";
- }
-
- $eventMarkup .= "{$header}
-
-
-
- {$quote}
- ";
-
- $lastDate = $dateInLoop;
- }
- }
- else {
- $eventMarkup = "
There are no events for this time period
";
- }
-
- $sidebar = $this->eventSidebar();
-
- $result = "
-
-
-
-
Events
-
{$eventMarkup}
-
- {$sidebar}
-
-
- ";
-
- return $result;
- }
-
-
-
- }
- public function existingNew($subtemplateTitle) {
-
- $existing = get_sub_field('existing_marketplace_content');
- $new = get_sub_field('new_marketplace_content');
-
- $result = "
-
-
{$subtemplateTitle}
-
-
Existing Marketplace
{$existing}
-
New Marketplace
{$new}
-
- ";
-
- return $result;
- }
- public function startedFast($subtemplateTitle) {
-
- $content = get_sub_field('content');
- $apiImg = get_sub_field('api_image')['url'];
- $whiteImg = get_sub_field('white_label_marketplace_image')['url'];
- $apiText = get_sub_field('api_text');
- $whiteText = get_sub_field('white_label_text');
-
- $result = "
-
-
{$subtemplateTitle}
-
{$content}
-
-
-
API
-
- {$apiText}
-
-
-
White Label Marketplace
-
- {$whiteText}
-
-
-
-
- ";
-
- return $result;
- }
-
- public function mainEventPage($subtemplateTitle) {
- $today = date('Ymd');
-
- $args = array(
- 'post_type' => 'event',
- 'order' => 'ASC',
- 'orderby' => 'meta_value',
- 'meta_key' => 'date',
- 'posts_per_page' => 20,
- 'meta_query' => array(
- array(
- 'key' => 'date',
- 'value' => $today, //array
- 'compare' => '>=',
- )
- )
- );
-
- $futureEvents = get_posts($args);
- $futureMarkup = '';
- $dateInLoop = '';
- $lastDate = '';
- if (!empty($futureEvents)) {
- foreach ($futureEvents as $item) {
- $id = $item->ID;
- $name = $item->post_title;
- $url = get_field('link_to_event',$id);
- $pubDate= get_field('date',$id);
- $quote = get_field('description',$id);
-
- $dateInLoop = date_create_from_format('F j, Y', $pubDate);
- $dateInLoop = date_format($dateInLoop, 'F Y');
- $header = '';
- if ($dateInLoop !== $lastDate) {
- $header = "
{$dateInLoop}
";
- }
-
- $futureMarkup .= "{$header}
-
-
-
- {$quote}
- ";
-
- $lastDate = $dateInLoop;
- }
- }
-
- $args = array(
- 'post_type' => 'event',
- 'order' => 'DESC',
- 'orderby' => 'meta_value',
- 'meta_key' => 'date',
- 'posts_per_page' => 10,
- 'meta_query' => array(
- array(
- 'key' => 'date',
- 'value' => $today, //array
- 'compare' => '<',
- )
- )
- );
-
- $pastEvents = get_posts($args);
- $pastMarkup = '';
- $lastDate = '';
- if (!empty($pastEvents)) {
- foreach ($pastEvents as $item) {
- $id = $item->ID;
- $name = $item->post_title;
- $url = get_field('link_to_event',$id);
- $pubDate= get_field('date',$id);
- $quote = get_field('description',$id);
-
- $dateInLoop = date_create_from_format('F j, Y', $pubDate);
- $dateInLoop = date_format($dateInLoop, 'F Y');
- $header = '';
- if ($dateInLoop !== $lastDate) {
-
- $header = "
{$dateInLoop}
";
- }
-
- $pastMarkup .= "{$header}
-
-
-
- {$quote}
- ";
-
- $lastDate = $dateInLoop;
- }
- }
-
- $sidebar = $this->eventSidebar();
-
- $result = "
-
-
-
-
Upcoming Events
-
{$futureMarkup}
-
- {$sidebar}
-
-
-
-
-
-
-
-
-
Past Events
-
{$pastMarkup}
-
-
-
- ";
-
- return $result;
- }
-
- public function eventSidebar() {
- $today = date('Ymd');
-
- $args = array(
- 'post_type' => 'event',
- 'order' => 'ASC',
- 'orderby' => 'meta_value',
- 'meta_key' => 'date',
- 'posts_per_page' => -1,
- 'meta_query' => array(
- array(
- 'key' => 'date',
- 'value' => $today, //array
- 'compare' => '>=',
- )
- )
- );
- $url = get_home_url();
- $futureEvents = get_posts($args);
- $futureListItems = '';
- $dateInLoop = '';
- $lastDate = '';
- if (!empty($futureEvents)) {
- foreach ($futureEvents as $item) {
- $id = $item->ID;
- $pubDate= get_field('date',$id);
-
- $dateInLoop = date_create_from_format('F j, Y', $pubDate);
- $dateTitle = date_format($dateInLoop, 'F Y');
-
- $dateForLink = date_format($dateInLoop,'Y').date_format($dateInLoop,'m').'01';
- if ($dateTitle !== $lastDate) {
- $url = get_home_url();
- $futureListItems .= "
{$dateTitle}";
- }
-
- $lastDate = $dateTitle;
- }
- }
-
- $args = array(
- 'post_type' => 'event',
- 'order' => 'DESC',
- 'orderby' => 'meta_value',
- 'meta_key' => 'date',
- 'posts_per_page' => -1,
- 'meta_query' => array(
- array(
- 'key' => 'date',
- 'value' => $today, //array
- 'compare' => '<',
- )
- )
- );
-
- $pastEvents = get_posts($args);
- $pastListItems = '';
- $lastDate = '';
- if (!empty($pastEvents)) {
- foreach ($pastEvents as $item) {
- $id = $item->ID;
- $pubDate= get_field('date',$id);
-
- $dateInLoop = date_create_from_format('F j, Y', $pubDate);
- $dateTitle = date_format($dateInLoop, 'F Y');
-
- $dateForLink = date_format($dateInLoop,'Y').date_format($dateInLoop,'m').'01';
- if ($dateTitle !== $lastDate) {
-
- $pastListItems .= "
{$dateTitle}";
- }
-
- $lastDate = $dateTitle;
- }
- }
-
- $result = "
";
-
- return $result;
- }
+
{$content}
+
{$teamMemberMarkup}
+