Skip to content

Commit

Permalink
CH-37: Changed custom field to require title and image so I could rem…
Browse files Browse the repository at this point in the history
…ove 2 cases from if
  • Loading branch information
vtotient committed Dec 28, 2018
1 parent 4446b61 commit 4eaf98a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 99 deletions.
98 changes: 2 additions & 96 deletions inc/home-page-banner-cf.php
Expand Up @@ -11,7 +11,7 @@
'name' => 'enable_home_page_title',
'type' => 'true_false',
'instructions' => '',
'required' => 0,
'required' => 1,
'conditional_logic' => 0,
'wrapper' => array(
'width' => '',
Expand Down Expand Up @@ -103,7 +103,7 @@
'name' => 'enable_home_page_image',
'type' => 'true_false',
'instructions' => '',
'required' => 0,
'required' => 1,
'conditional_logic' => 0,
'wrapper' => array(
'width' => '',
Expand Down Expand Up @@ -167,98 +167,4 @@
'active' => 1,
'description' => '',
));

acf_add_local_field_group(array(
'key' => 'group_5bf614278d612',
'title' => 'Home Page Button',
'fields' => array(
array(
'key' => 'field_5bf6142d6965c',
'label' => 'home page button enable',
'name' => 'home_page_button_enable',
'type' => 'true_false',
'instructions' => '',
'required' => 0,
'conditional_logic' => 0,
'wrapper' => array(
'width' => '',
'class' => '',
'id' => '',
),
'message' => '',
'default_value' => 0,
'ui' => 0,
'ui_on_text' => '',
'ui_off_text' => '',
),
array(
'key' => 'field_5bf6149d6965d',
'label' => 'home page button text',
'name' => 'home_page_button_text',
'type' => 'text',
'instructions' => '',
'required' => 0,
'conditional_logic' => array(
array(
array(
'field' => 'field_5bf6142d6965c',
'operator' => '==',
'value' => '1',
),
),
),
'wrapper' => array(
'width' => '',
'class' => '',
'id' => '',
),
'default_value' => 'Join Us',
'placeholder' => '',
'prepend' => '',
'append' => '',
'maxlength' => '',
),
array(
'key' => 'field_5bf61e9945327',
'label' => 'home page button link',
'name' => 'home_page_button_link',
'type' => 'link',
'instructions' => '',
'required' => 0,
'conditional_logic' => array(
array(
array(
'field' => 'field_5bf6142d6965c',
'operator' => '==',
'value' => '1',
),
),
),
'wrapper' => array(
'width' => '',
'class' => '',
'id' => '',
),
'return_format' => 'url',
),
),
'location' => array(
array(
array(
'param' => 'page',
'operator' => '==',
'value' => '127',
),
),
),
'menu_order' => 0,
'position' => 'normal',
'style' => 'default',
'label_placement' => 'top',
'instruction_placement' => 'label',
'hide_on_screen' => '',
'active' => 1,
'description' => '',
));

endif; ?>
5 changes: 2 additions & 3 deletions template-parts/home-page-banner.php
@@ -1,13 +1,12 @@
<?php if( get_field("enable_home_page_title") && get_field("home_page_title")
&& get_field("home_page_image") ): ?>
<?php if( get_field("enable_home_page_title") ): ?>

<div class="row ml-4 mr-4 pb-4 home-page-banner" style="background-image: url('<?php the_field('home_page_image'); ?>')" >

<div class="col md-6">
<div class ="home-page-banner-bottom-left pl-4">
<h4 class="font-weight-bold text-white overlay w-50 bg-dark pl-3 pr-3 pb-3 pt-3"> <?php the_field("home_page_title"); ?> </h4>
<?php if( get_field("enable_home_page_text") && get_field("home_page_text") ): ?>
<p class="pl-3 pr-3 pb-3 pt-3 home-page-banner-width-paragraph bg-light"> <?php echo get_field("home_page_text", false, false); ?> </p>
<p class="pl-3 pr-3 pb-3 pt-3 w-50 bg-light"> <?php echo get_field("home_page_text", false, false); ?> </p>
<?php endif; ?>

<?php if( get_field("home_page_button_enable") && get_field("home_page_button_text") && get_field("home_page_button_link") ): ?>
Expand Down

0 comments on commit 4eaf98a

Please sign in to comment.