Skip to content

Commit

Permalink
#2755 Added in master
Browse files Browse the repository at this point in the history
  • Loading branch information
MARQAS committed Feb 4, 2019
1 parent 48e0c08 commit 8b56412
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
5 changes: 4 additions & 1 deletion components/comments/comments.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ function ampforwp_framework_get_comments(){
// Gather comments for a specific page/post
$postID = $comments = $max_page = "";
$postID = get_the_ID();
if ( ampforwp_is_front_page() ) {
$postID = ampforwp_get_frontpage_id();
}
$comments = get_comments(array(
'post_id' => $postID,
'status' => 'approve' //Change this to the type of comments to be displayed
Expand Down Expand Up @@ -105,7 +108,7 @@ function ampforwp_custom_translated_comment($comment, $args, $depth){
} // if ( $comments )
if ( ! defined( 'AMP_COMMENTS_VERSION' ) ) { ?>
<div class="amp-comment-button">
<?php if ( comments_open() ) { ?>
<?php if ( comments_open($postID) ) { ?>
<a href="<?php echo ampforwp_comment_button_url(); ?>" rel="nofollow"><?php echo esc_html(ampforwp_translation( $redux_builder_amp['amp-translator-leave-a-comment-text'], 'Leave a Comment' ) ); ?></a> <?php
} else {
echo "<p class='nocomments'>". esc_html( ampforwp_translation( $redux_builder_amp['amp-translator-comments-closed'], 'Comments are closed' ) )." </p>";
Expand Down
7 changes: 4 additions & 3 deletions templates/design-manager/swift/style.php
Original file line number Diff line number Diff line change
Expand Up @@ -339,12 +339,13 @@
blockquote{margin-bottom:20px;}
blockquote p {font-size: 34px; line-height: 1.4; font-weight: 700; position: relative; padding: 30px 0 0 0; }
blockquote p:before {content: "";border-top: 8px solid #000;width: 115px;line-height: 40px;display: inline-block;position: absolute;top: 0;}
.form-submit #submit{background-color: #005be2;font-size: 14px;text-align: center;border-radius: 3px;font-weight: 500;color: #fff;cursor: pointer;margin: 0;border: 0;padding: 11px 21px;}
#respond p {margin: 12px 0;}
<?php if( !checkAMPforPageBuilderStatus(get_the_ID()) && ampforwp_get_comments_status() ){ ?>
.amp-comment-button{background-color: <?php echo ampforwp_sanitize_color($redux_builder_amp['swift-color-scheme']['color']) ?>;font-size: 15px;float: none;margin: 30px auto 0px auto;text-align: center;border-radius: 3px;font-weight: 600;width:250px;}
.amp-comment-button .nocomments{color: #fff;display: block;padding: 7px 0px 8px 0px;}
.cmts{width:100%;display:inline-block;clear:both;margin-top:40px;}
.amp-comment-button{background-color: <?php echo ampforwp_sanitize_color($redux_builder_amp['swift-color-scheme']['color']) ?>;font-size: 15px;float: none;margin: 30px auto 0px auto;text-align: center;border-radius: 3px;font-weight: 600;width:250px;}
.form-submit #submit{background-color: #005be2;font-size: 14px;text-align: center;border-radius: 3px;font-weight: 500;color: #fff;cursor: pointer;margin: 0;border: 0;padding: 11px 21px;}
#respond p {margin: 12px 0;}
.amp-comment-button a{color: #fff;display: block;padding: 7px 0px 8px 0px;}
.comment-form-comment #comment {border-color: #ccc;width: 100%;padding: 20px;}
.cmts h3{margin: 0;font-size: 12px;padding-bottom: 6px;border-bottom: 1px solid #eee;font-weight: 400;letter-spacing: 0.5px;text-transform: uppercase;color: #444;}
Expand All @@ -360,7 +361,7 @@
.comment-content{margin-top:6px;width:100%;display:inline-block;}
.comment-content p{font-size: 14px;color: #333;line-height: 22px;font-weight: 400;margin: 0;}
.comment-meta amp-img{float:left;margin-right:10px;border-radius:50%;width:40px;}

<?php } ?>

@media (max-width: 480px){
blockquote p {font-size:20px;}
Expand Down
9 changes: 6 additions & 3 deletions templates/features.php
Original file line number Diff line number Diff line change
Expand Up @@ -7309,14 +7309,17 @@ function ampforwp_return_no_gap(){
function ampforwp_get_comments_status(){
global $redux_builder_amp;
$display_comments_on = "";
if ( (isset($redux_builder_amp['ampforwp-display-on-pages']) && $redux_builder_amp['ampforwp-display-on-pages']==false ) && (isset($redux_builder_amp['ampforwp-display-on-posts']) && $redux_builder_amp['ampforwp-display-on-posts']==true ) ) {
if ( false == ampforwp_get_setting('ampforwp-display-on-pages') && true == ampforwp_get_setting('ampforwp-display-on-posts') ) {
$display_comments_on = is_single();
}
if ( (isset($redux_builder_amp['ampforwp-display-on-pages']) && $redux_builder_amp['ampforwp-display-on-pages']==true ) && (isset($redux_builder_amp['ampforwp-display-on-posts']) && $redux_builder_amp['ampforwp-display-on-posts']==false ) ) {
if ( true == ampforwp_get_setting('ampforwp-display-on-pages') && false == ampforwp_get_setting('ampforwp-display-on-posts') ) {
$display_comments_on = is_page();
}
if ( (isset($redux_builder_amp['ampforwp-display-on-pages']) && $redux_builder_amp['ampforwp-display-on-pages']==true ) && (isset($redux_builder_amp['ampforwp-display-on-posts']) && $redux_builder_amp['ampforwp-display-on-posts']==true ) ) {
if ( true == ampforwp_get_setting('ampforwp-display-on-pages') && true == ampforwp_get_setting('ampforwp-display-on-posts')) {
$display_comments_on = is_singular();
if ( ampforwp_is_front_page() ) {
$display_comments_on = ampforwp_is_front_page();
}
}
$display_comments_on = apply_filters('ampforwp_comments_visibility', $display_comments_on);
return $display_comments_on;
Expand Down

0 comments on commit 8b56412

Please sign in to comment.