Skip to content

Commit

Permalink
Merge pull request #42 from CodetheChangeFoundation/CH-37
Browse files Browse the repository at this point in the history
Ch 37
  • Loading branch information
vtotient committed Jan 4, 2019
2 parents d99f139 + 4eaf98a commit b95cfc2
Show file tree
Hide file tree
Showing 6 changed files with 219 additions and 1 deletion.
14 changes: 14 additions & 0 deletions assets/css/climatehub.css
Expand Up @@ -44,3 +44,17 @@
.active.shrink::before {
border-bottom: 59px solid #000 !important;
}

.home-page-banner-bottom-left{
position: absolute;
bottom: 0;
left: 0;
}

.home-page-banner{
height: 60vh;
}

.home-page-banner-width-paragraph{
width: 58%;
}
Binary file added assets/images/test-image-ctc.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion functions.php
Expand Up @@ -14,4 +14,4 @@
require get_template_directory() . '/custom-fields/partners-content-section.php';
require get_template_directory() . '/inc/bs4navwalker.php';
require get_template_directory() . '/custom-fields/updatebox-section.php';
?>
require get_template_directory() . '/inc/home-page-banner-cf.php';
170 changes: 170 additions & 0 deletions inc/home-page-banner-cf.php
@@ -0,0 +1,170 @@
<?php
if( function_exists('acf_add_local_field_group') ):

acf_add_local_field_group(array(
'key' => 'group_5be625bb048f9',
'title' => 'Home Page Banner',
'fields' => array(
array(
'key' => 'field_5be627a8e6478',
'label' => 'enable home page title',
'name' => 'enable_home_page_title',
'type' => 'true_false',
'instructions' => '',
'required' => 1,
'conditional_logic' => 0,
'wrapper' => array(
'width' => '',
'class' => '',
'id' => '',
),
'message' => '',
'default_value' => 0,
'ui' => 0,
'ui_on_text' => '',
'ui_off_text' => '',
),
array(
'key' => 'field_5be627ece6479',
'label' => 'home page title',
'name' => 'home_page_title',
'type' => 'text',
'instructions' => '',
'required' => 0,
'conditional_logic' => array(
array(
array(
'field' => 'field_5be627a8e6478',
'operator' => '==',
'value' => '1',
),
),
),
'wrapper' => array(
'width' => '',
'class' => '',
'id' => '',
),
'default_value' => 'Building a hopeful community around action on climate change',
'placeholder' => '',
'prepend' => '',
'append' => '',
'maxlength' => '',
),
array(
'key' => 'field_5be62823e647a',
'label' => 'enable home page text',
'name' => 'enable_home_page_text',
'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_5be628463b150',
'label' => 'home page text',
'name' => 'home_page_text',
'type' => 'wysiwyg',
'instructions' => '',
'required' => 0,
'conditional_logic' => array(
array(
array(
'field' => 'field_5be62823e647a',
'operator' => '==',
'value' => '1',
),
),
),
'wrapper' => array(
'width' => '',
'class' => '',
'id' => '',
),
'default_value' => '',
'tabs' => 'all',
'toolbar' => 'full',
'media_upload' => 1,
'delay' => 0,
),
array(
'key' => 'field_5be628593b151',
'label' => 'enable home page image',
'name' => 'enable_home_page_image',
'type' => 'true_false',
'instructions' => '',
'required' => 1,
'conditional_logic' => 0,
'wrapper' => array(
'width' => '',
'class' => '',
'id' => '',
),
'message' => '',
'default_value' => 0,
'ui' => 0,
'ui_on_text' => '',
'ui_off_text' => '',
),
array(
'key' => 'field_5be628ab3b152',
'label' => 'home page image',
'name' => 'home_page_image',
'type' => 'image',
'instructions' => '',
'required' => 0,
'conditional_logic' => array(
array(
array(
'field' => 'field_5be628593b151',
'operator' => '==',
'value' => '1',
),
),
),
'wrapper' => array(
'width' => '',
'class' => '',
'id' => '',
),
'return_format' => 'url',
'preview_size' => 'large',
'library' => 'all',
'min_width' => '',
'min_height' => '',
'min_size' => '',
'max_width' => '',
'max_height' => '',
'max_size' => '',
'mime_types' => '',
),
),
'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; ?>
14 changes: 14 additions & 0 deletions index.php
Expand Up @@ -9,6 +9,20 @@
<?php get_template_part( "template-parts/paragraph") ?>
</div>

<div class="container-fluid">
<?php get_template_part( "template-parts/contact-us" ) ?>
<?php get_template_part( "template-parts/address-title" ) ?>
</div>

<div class="container">
<?php get_template_part( "template-parts/contact-us-button" ) ?>
</div>

</div class="jumbotron d-flex flex-column border border-primary justify-content-end align-content-start p-0">
<?php get_template_part("template-parts/home-page-banner") ?>
</div>

<?php get_template_part( 'template-parts/partners-content-section' )?>
<?php get_template_part( 'template-parts/updatebox-section' )?>

<?php get_footer(); ?>
20 changes: 20 additions & 0 deletions template-parts/home-page-banner.php
@@ -0,0 +1,20 @@
<?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 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") ): ?>
<a role="button" href="<?php echo the_field("home_page_button_link"); ?>" class="btn btn-outline-primary font-italic align-middle"> <?php the_field("home_page_button_text")?> </a>
<?php endif; ?>
</div>
</div>

</div>

<?php endif; ?>

0 comments on commit b95cfc2

Please sign in to comment.