Reply To: Conditional display of a full width call to action section AND footer widgets?

Home Forums Support Conditional display of a full width call to action section AND footer widgets? Reply To: Conditional display of a full width call to action section AND footer widgets?

Home Forums Support Conditional display of a full width call to action section AND footer widgets? Reply To: Conditional display of a full width call to action section AND footer widgets?

#153872
Tom
Lead Developer
Lead Developer

Hi there,

For your call to action, I would suggest something like this: https://generatepress.com/forums/topic/change-site-header-and-title-based-on-page/#post-111841

So you would:

1. On your page, click the “Screen Options” tab at the top right of the page. Make sure the “Custom Fields” checkbox is checked.

2. Now look for the “Custom Fields” metabox – click “Enter new”.

3. Under “Name”, add: cta_section

4. Under “Value”, enter the call to action.

5. Now in GP Hooks, in the “Before Footer” hook, add this:

<?php
global $post;
$cta = get_post_meta($post->ID, 'cta_section', true);
if ( ! empty( $cta) ) : ?>
      <div class="grid-container">
            <?php echo $cta; ?>
      </div>
<?php endif; ?>

Be sure to check the “Execute PHP” checkbox.

Then you can add your CTA in the custom fields section on each applicable page.

For the footer widgets, you can just turn them on or off like this: https://generatepress.com/knowledgebase/choosing-footer-widgets/#individual

Hope this helps 🙂