mirror of
https://github.com/ascribe/wp-theme
synced 2024-12-22 17:23:55 +01:00
handle empty title
This commit is contained in:
parent
3ffac44177
commit
dfe7d978db
@ -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>";
|
||||
|
Loading…
Reference in New Issue
Block a user