Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 21 additions & 2 deletions CleanBuild/functions/acf/acf-fields-company-details.php
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,25 @@
'layout' => 'table',
'button_label' => 'Add Phone Number',
'sub_fields' => array(
array(
'key' => 'field_5bb611f4e6a06',
'label' => 'Area Code',
'name' => 'area_code',
'type' => 'text',
'instructions' => '',
'required' => 0,
'conditional_logic' => 0,
'wrapper' => array(
'width' => '20',
'class' => '',
'id' => '',
),
'default_value' => '',
'placeholder' => '',
'prepend' => '',
'append' => '',
'maxlength' => '',
),
array(
'key' => 'field_5a5f6c316b5fe',
'label' => 'Phone Number',
Expand All @@ -244,7 +263,7 @@
'required' => 0,
'conditional_logic' => 0,
'wrapper' => array(
'width' => '',
'width' => '80',
'class' => '',
'id' => '',
),
Expand Down Expand Up @@ -355,4 +374,4 @@
));

endif;
?>
?>
9 changes: 7 additions & 2 deletions CleanBuild/functions/acf/acf-shortcodes.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,14 +101,19 @@ function company_phone_number_func( $atts ){
while ( have_rows('company_phone_number', 'company') ) : the_row();
$counter++;
$number = get_sub_field('phone_number');
if (get_sub_field('area_code')){
$areacode = get_sub_field('area_code');
} else {
$areacode = '+44';
}
$first_number = substr($number, 0, 1);
if($first_number == 0) {
$number_short = substr($number, 1);
$number_space = str_replace(' ', '', $number_short);
$number_link = '+44' . $number_space;
$number_link = $areacode . $number_space;
} else {
$number_space = str_replace(' ', '', $number);
$number_link = '+44' . $number_space;
$number_link = $areacode . $number_space;
}

if($row == $counter) {
Expand Down
15 changes: 15 additions & 0 deletions CleanBuild/functions/wordpress/wordpress-custom.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,21 @@ function post_link_attributes($output) {
// CUSTOM IMAGE SIZES
add_image_size( 'small-on-page', 150, 60 );

//REMOVE THE APPENDED WORDS IN FRONT OF CAT, TAG & AUTHOR TITLES
function remove_static_title( $title ) {
if ( is_category() ) {
$title = single_cat_title( '', false );
} elseif ( is_tag() ) {
$title = single_tag_title( '', false );
} elseif ( is_archive() ) {
$title = single_tag_title( '', false );
} elseif ( is_author() ) {
$title = '<span class="vcard">' . get_the_author() . '</span>' ;
}
return $title;
}
add_filter( 'get_the_archive_title', 'remove_static_title' );


// MOVE YOAST META BOX TO THE BOTTOM
function yoasttobottom() {
Expand Down
26 changes: 24 additions & 2 deletions CleanBuild/inc/footer/backstretch-script.php
Original file line number Diff line number Diff line change
@@ -1,13 +1,35 @@
<script type="text/javascript">

<?php

//Set up $option variable so we can grab banner_images from the news and other custom post types too.
global $post;

//Get post ID by defualt
$option = $post->ID;

//if news pages get page for posts
if ( is_home() || is_single() || is_category() ) {
$option = get_option('page_for_posts');
}

// You can extend this to work for custom post types too e.g.
/*
if ( is_singular('cases') || is_post_type_archive('cases') ){
$option = 'cases';
}
*/

?>

var $ = jQuery.noConflict();

$(document).ready(function(){

$('.slider').backstretch([
<?php
if(get_field('banner_images')) {
$images = get_field('banner_images');
if(get_field('banner_images', $option)) {
$images = get_field('banner_images', $option);
foreach($images as $img) {
$img = $img['url'];
echo '"'. $img .'",';
Expand Down