1
0
mirror of https://github.com/ascribe/wp-theme synced 2025-01-03 18:35:08 +01:00

handle empty title

This commit is contained in:
Matthias Kretschmann 2015-12-12 19:35:38 +01:00
parent 3ffac44177
commit dfe7d978db

View File

@ -296,7 +296,10 @@ class Subtemplate {
return $result; return $result;
} }
public function callToAction($subtemplateTitle) { public function callToAction($subtemplateTitle) {
$ctaTitle = $subtemplateTitle;
if ($subtemplateTitle) {
$ctaTitle = "<h1 class='cta__title'>$subtemplateTitle</h1>";
}
$ctaText = get_sub_field('cta_button_text'); $ctaText = get_sub_field('cta_button_text');
$ctaLink = get_sub_field('cta_button_link'); $ctaLink = get_sub_field('cta_button_link');
$backgroundImg = get_sub_field('image')['url']; $backgroundImg = get_sub_field('image')['url'];
@ -304,7 +307,7 @@ class Subtemplate {
$result = "<section class='subtemplate cta' style='background-image: url({$backgroundImg})'> $result = "<section class='subtemplate cta' style='background-image: url({$backgroundImg})'>
<div class='centered-content'> <div class='centered-content'>
<h1 class='cta__title'>{$ctaTitle}</h1> {$ctaTitle}
<a href='{$ctaLink}' class='cta__button button blue-overPic'>{$ctaText}</a> <a href='{$ctaLink}' class='cta__button button blue-overPic'>{$ctaText}</a>
</div> </div>
</section>"; </section>";