1
0
mirror of https://github.com/ascribe/wp-theme synced 2024-12-22 09:13:38 +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;
}
public function callToAction($subtemplateTitle) {
$ctaTitle = $subtemplateTitle;
if ($subtemplateTitle) {
$ctaTitle = "<h1 class='cta__title'>$subtemplateTitle</h1>";
}
$ctaText = get_sub_field('cta_button_text');
$ctaLink = get_sub_field('cta_button_link');
$backgroundImg = get_sub_field('image')['url'];
@ -304,7 +307,7 @@ class Subtemplate {
$result = "<section class='subtemplate cta' style='background-image: url({$backgroundImg})'>
<div class='centered-content'>
<h1 class='cta__title'>{$ctaTitle}</h1>
{$ctaTitle}
<a href='{$ctaLink}' class='cta__button button blue-overPic'>{$ctaText}</a>
</div>
</section>";