Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
lovelyeden committed Jun 18, 2019
2 parents ed967db + 2ce9fa0 commit c6f8fa3
Show file tree
Hide file tree
Showing 13 changed files with 201 additions and 46 deletions.
16 changes: 15 additions & 1 deletion plugins/rethink-functionality/lib/functions/rest-api.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,18 @@ function rc_slug_register_charity() {

function rc_slug_get_charity_field( $post, $field_name ) {
return CFS()->get( $field_name, $post[ 'id' ] );
}
}


// function rc_post_featured_image_json( $data, $post, $context ) {
// $featured_image_id = $data->data['featured_media']; // get featured image id
// $featured_image_url = wp_get_attachment_image_src( $featured_image_id, 'large' ); // get url of the original size

// if( $featured_image_url ) {
// $data->data['featured_image_url'] = $featured_image_url[0];
// }

// return $data;
// }
// add_filter( 'rest_prepare_post', 'rc_post_featured_image_json', 10, 3 );

10 changes: 3 additions & 7 deletions themes/rcforward/inc/template-tags.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,19 @@
/**
* Custom template tags for this theme.
*
* @package RED_Starter_Theme
* @package RC_Forward
*/

/**
* Prints HTML with meta information for the current post-date/time.
*/
function red_starter_posted_on() {
$time_string = '<time class="entry-date published updated" datetime="%1$s">%2$s</time>';
if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) {
$time_string = '<time class="entry-date published" datetime="%1$s">%2$s</time><time class="updated" datetime="%3$s">%4$s</time>';
}


$time_string = sprintf( $time_string,
esc_attr( get_the_date( 'c' ) ),
esc_html( get_the_date() ),
esc_attr( get_the_modified_date( 'c' ) ),
esc_html( get_the_modified_date() )
esc_html( get_the_date('F j, Y') )
);

$posted_on = sprintf( esc_html( '%s' ), $time_string );
Expand Down
5 changes: 3 additions & 2 deletions themes/rcforward/js/charity-category.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,9 @@
$.each(value.charity_tax, function(index, id){
console.log(taxId);
if(id == taxId){
console.log(id);
let $thumbnailLink = value._embedded["wp:featuredmedia"][0].source_url;
console.log(value);
// let $thumbnailLink = value.featured_image_url;
let $thumbnailLink = value._embedded["wp:featuredmedia"][0].media_details.sizes.medium.source_url;
let $logoLink = value.charity_logo;
let $title = value.title.rendered;
let $description = value.charity_description.substring(75)+" [...]";
Expand Down
15 changes: 13 additions & 2 deletions themes/rcforward/js/flickity.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,22 @@
(function($) {
$(function() {
const $carousel = $('.main-carousel');
if($carousel.hasClass("related-charities")){
$carousel.flickity({
contain: true,
wrapAround: true,
setGallerySize:false,
});
}else{
$carousel.flickity({

$('.main-carousel').flickity({
cellAlign: 'left',
contain: true,
wrapAround: true
wrapAround: true,
setGallerySize:false,
});
}


}); // End of Doc ready
})(jQuery);
Expand Down
7 changes: 5 additions & 2 deletions themes/rcforward/sass/_content.scss
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,11 @@ body{
}
@include desktop{
padding:5rem;

}
}
<<<<<<< HEAD

=======
/* Chimp Donate Button */
.chimp-donate-form {
background: $code__blue;
Expand All @@ -73,4 +75,5 @@ body{
border-radius: 6px;
color: $grounded__green;
font-weight: bold;
}
}
>>>>>>> 13446c5441c5a41af894e506924c9b3ec9456ae3
12 changes: 5 additions & 7 deletions themes/rcforward/sass/_flickity.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
.flickity-viewport {
position: relative;
height:270px;

// &::before {
// content: '';
// left: 0;
Expand Down Expand Up @@ -64,16 +65,13 @@ ol.flickity-page-dots{
}
}
.carousel-cell {
box-shadow: 0px 2px 2px $innovative__purple;
@include box-shadow();
width: 23.5%; /* half-width */
height: 230px;
margin: 0 1%;
border-radius: 10px;
margin: 0 5px;

overflow: hidden;
border:1px solid lighten($innovative__purple,50%);
&:hover{
box-shadow: 0px 3px 5px $innovative__purple;
}

img{
max-width: 100%;
max-height:100%;
Expand Down
55 changes: 48 additions & 7 deletions themes/rcforward/sass/_front-page.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
text-align: center;
.why-donate-content{
@include display-flex();
padding:2rem 6rem;
padding:2rem 7rem;
justify-content: space-between;
img{
width:120px;
Expand All @@ -28,11 +28,7 @@
height:130px;
margin:0 auto;
}
border:1px solid lighten($innovative__purple,50%);
box-shadow: 0px 2px 2px $innovative__purple;
&:hover{
box-shadow: 0px 3px 5px $innovative__purple;
}
@include box-shadow();
button, a{
background:$credible__blue;
padding:$button__padding;
Expand All @@ -47,4 +43,49 @@
}

}
}
}

//front page

.home{
text-align:center;
.entry-header{

}

.choose-fund{
padding:$content__padding;
.choose-fund-subtitle{
font-weight:600;
}
.choose-fund-description{
margin:0 auto;
}

.fund{
@include display-flex();
margin:3rem auto;
justify-content: space-between;
.fund-entry{
@include box-shadow();
padding:1rem;
flex-basis:30%;
display:grid;
grid-template-columns: 1fr;
grid-template-rows:60px auto 130px 55px;
img{
width:80px;
height:80px;
margin:0 auto;
}
a{
@include button();
}
}
}


}
}


22 changes: 22 additions & 0 deletions themes/rcforward/sass/_mixins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,26 @@
flex-direction: $flexDirection;
justify-content: $justifyContent;
align-items: $alignItems;
}

@mixin box-shadow(){
border-radius: 10px;
border:1px solid lighten($innovative__purple,50%);
box-shadow: 0px 2px 2px $innovative__purple;
&:hover{
box-shadow: 0px 3px 5px $innovative__purple;
}
}

@mixin button($background-color: $innovative__purple){
padding:$button__padding;
background-color:$background-color;
border-radius: 7px;
width:10rem;
display: flex;
justify-content: center;
align-items: center;
color:white;
text-align: center;
margin: 0 auto;
}
3 changes: 2 additions & 1 deletion themes/rcforward/sass/_variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ $gotham__font: 'Montserrat Light', sans-serif;
// RC Mixins
$tablet-width: 600px;
$desktop-width: 1000px;
$max-screen-size: 1240px;
$max-screen-size: 1440px;

// Typography

Expand All @@ -52,3 +52,4 @@ $font__line-height-pre: 1.6;
//padding

$button__padding: 1rem 1.5rem;
$content__padding: 2rem 6rem;
18 changes: 9 additions & 9 deletions themes/rcforward/single-charity.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
foreach ( $main_contents as $main_content ):
$index++;
?>
<div class="single-content">
<div class="single-content ">
<?php
if($main_content['image'] && $index === $count):
?>
Expand All @@ -73,20 +73,20 @@
<?php echo $charity_report_button; ?>
<?php echo $charity_website_button; ?>
</div>
<h3 class =".content-w-image" ><?php echo $main_content['title']; ?></h3>
<p class =".content-w-image"><?php echo $main_content['content']; ?></p>
<h3 class ="content-w-image" ><?php echo $main_content['title']; ?></h3>
<p class ="content-w-image"><?php echo $main_content['content']; ?></p>
<?php elseif($main_content['image'] && $index !== $count):?>
<div class="content-image">
<img class="main-content-image" src="<?php echo $main_content['image']; ?>">
</div>
<h3 class =".content-w-image" ><?php echo $main_content['title']; ?></h3>
<p class =".content-w-image"><?php echo $main_content['content']; ?></p>
<h3 class ="content-w-image" ><?php echo $main_content['title']; ?></h3>
<p class ="content-w-image"><?php echo $main_content['content']; ?></p>
<?php elseif(!$main_content['image'] && $index !== $count):?>
<h3 class =".content-wo-image" ><?php echo $main_content['title']; ?></h3>
<p class =".content-wo-image"><?php echo $main_content['content']; ?></p>
<h3 class ="content-wo-image" ><?php echo $main_content['title']; ?></h3>
<p class ="content-wo-image"><?php echo $main_content['content']; ?></p>
<?php else: ?>
<h3 class =".content-wo-image" ><?php echo $main_content['title']; ?></h3>
<p class =".content-wo-image"><?php echo $main_content['content']; ?></p>
<h3 class ="content-wo-image" ><?php echo $main_content['title']; ?></h3>
<p class ="content-wo-image"><?php echo $main_content['content']; ?></p>
<?php echo $charity_report_button; ?>
<?php echo $charity_website_button; ?>
<?php endif; ?>
Expand Down
2 changes: 1 addition & 1 deletion themes/rcforward/single-fund.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
<img class="charity-logo" src="<?php echo CFS()->get( 'charity_logo', $the_post->ID ); ?>"/>
<?php $charity_description = CFS()->get( 'charity_description', $the_post->ID ,array( 'format' => 'raw' )); ?>
<!-- <?php var_dump($charity_description); ?> -->
<p class="charity-description"><?php wp_trim_words($charity_description, $num_words =50, $more ="[...]"); ?></p>
<p class="charity-description"><?php echo wp_trim_words($charity_description, 10, " [...]"); ?></p>
<a class="read-more-button" href="<?php echo $the_post->guid; ?>">View Charity &#x203A;</a>
</div>

Expand Down
Loading

0 comments on commit c6f8fa3

Please sign in to comment.