Custom Row not Appearing on Live Site

Permalink
OK, so I am using the elemental theme for a simple cigar shop site I built. I modified the header grid and the footer grid with no problem and everything shows up fine. I created a custom row where I have 4 columns for logos in the space where footerSiteTitle and footerSocial were and that is where I am stuck. I am pretty sure I need to change something at the top of this code but I am not sure what to do. Here is the code I have now:
<?php defined('C5_EXECUTE') or die("Access Denied.");
$footerSiteTitle = new GlobalArea('Footer Site Title');
$footerSocial = new GlobalArea('Footer Social');
$footerSiteTitleBlocks = $footerSiteTitle->getTotalBlocksInArea();
$footerSocialBlocks = $footerSocial->getTotalBlocksInArea();
$displayFirstSection = $footerSiteTitleBlocks > 0 || $footerSocialBlocks > 0 || $c->isEditMode();
?>
<footer id="footer-theme">
    <?php if ($displayFirstSection) { ?>
    <section>
    <div class="container">
        <div class="row">
            <div class="col-sm-3">
                <?php
                $a = new GlobalArea('Footer Logo 1');

When I am in edit mode I can add content (images) and they appear just fine. When I exit edit mode the entire row is invisible and I can't figure out why. I have attached a screenshot in edit mode. Any help or guidance is greatly appreciated.
Here is a link to the site:
http://villagecigar.com/

1 Attachment

sully210
 
MrKDilkington replied on at Permalink Best Answer Reply
MrKDilkington
Hi sully210,

Your row of images is being conditionally displayed.
<?php if ($displayFirstSection) { ?>

This determines the true/false value of $displayFirstSection.
$displayFirstSection = $footerSiteTitleBlocks > 0 || $footerSocialBlocks > 0 || $c->isEditMode();

$displayFirstSection is true if there is at least one block in the "Footer Site Title" area
$displayFirstSection is true if there is at least one block in the "Footer Social" area
$displayFirstSection is true if the page is in Edit Mode

Since there are no blocks in either area, once you leave Edit Mode, your row of images is not displayed.

Remove the code that sets a value for $displayFirstSection
$footerSiteTitle = new GlobalArea('Footer Site Title');
$footerSocial = new GlobalArea('Footer Social');
$footerSiteTitleBlocks = $footerSiteTitle->getTotalBlocksInArea();
$footerSocialBlocks = $footerSocial->getTotalBlocksInArea();
$displayFirstSection = $footerSiteTitleBlocks > 0 || $footerSocialBlocks > 0 || $c->isEditMode();

Remove the opening and closing if lines
<?php if ($displayFirstSection) { ?> // remove
    // do not remove row code
<?php } ?> // remove
sully210 replied on at Permalink Reply
sully210
You are AWESOME man! Thank you so much. I learn more and more every day thanks to people like you. Can't thank you enough. Have a great Memorial day.