Site Builder
Editing:
modules-cta.php
writable 0666
<?php /************************************************************************** * CTA MODULE – Call to Action cards (gold outline) * ---------------------------------------------------------------------- * • Reads ../../cta.json (array of {title,html,button{label,url}}) * • Shows one card per entry **************************************************************************/ /* 1) Load CTA JSON */ $ctas = get_cta(); if (!$ctas) return; ?> <section class="cta-shell"> <?php foreach ($ctas as $i => $c): $title = $c['title'] ?? ''; $html = $c['html'] ?? ''; $btn = $c['button'] ?? []; if (!$title && !$html) continue; ?> <a name="cta"></a> <div class="cta-card"> <?php if ($title): ?><h2><?= $title ?></h2><?php endif; ?> <?php if ($html): ?> <div class="cta-body"><?= $html /* already HTML-escaped in JSON */ ?></div> <?php endif; ?> <?php if (!empty($btn['label']) && !empty($btn['url'])): ?> <p class="cta-action"> <a class="cta-btn" href="<?= htmlspecialchars($btn['url']) ?>" target="_blank" rel="noopener"> <?= htmlspecialchars($btn['label']) ?> </a> </p> <?php endif; ?> </div> <?php endforeach; ?> </section> <style> /* ----- wrapper keeps width consistent with other gold cards ----- */ .cta-shell{ margin:2.6rem auto; max-width:clamp(480px,70vw,720px); width:100%; font-family:system-ui,Arial,sans-serif; } /* ----- card ----- */ .cta-card{ background:#fff; padding:1.8rem 1.6rem; border:3.5px solid #ffb63b; border-radius:27px; box-shadow:0 8px 26px rgba(0,0,0,.06); margin-bottom:2.2rem; text-align:center; /* keeps the heading in the middle */ } .cta-card h2{ margin:0 0 1rem; font-size:1.35rem; font-weight:700; color:#102a66; } /* ----- body text ----- */ .cta-body{ font-size:1.05rem; color:#333; line-height:1.55; margin-bottom:1.3rem; /* NEW: left‑align paragraphs & lists */ text-align:left; } /* bullets & numbered lists: normal left indent */ .cta-body ul, .cta-body ol{ margin:0 0 1.1rem 1.25rem; padding:0; } .cta-body li{ text-align:left; } /* makes sure nested text stays left */ /* ----- button ----- */ .cta-btn{ display:inline-block; background:#2357d7; color:#fff; padding:.65em 1.9em; border-radius:8px; font-weight:700; font-size:1.05rem; text-decoration:none; box-shadow:0 2px 6px rgba(0,0,0,.1); transition:background .15s; } .cta-btn:hover{ background:#1e4dbf; } </style>
Save changes
Create folder
writable 0777
Create
Cancel