This repository has been archived by the owner on Jan 10, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
36 - Single product template #39
Merged
Merged
Changes from all commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
e4f82c1
36 - Single product HTML
mehigh 9d60672
Start adding theme implementation for single-adventure.php
miina dcb8d4b
Fix phpcs.
miina 4157d49
Fix CS.
miina a1f0c89
Add method comment.
miina 2b9645a
Merge develop & resolve conflicts.
miina e2ea438
Add functionality for comments. Refactor templates.
miina ae3ac4d
Add nonce based on default comments saving. Show rating empty by defa…
miina c5efef8
Add ampState for price.
miina 0d6065f
Merge in develop, delete editor-blocks.js.
kienstra fced3dc
36 - top hero carousel
mehigh 2e29d94
36 - Product details adjustments for responsiveness
mehigh b656c60
36 - Sticky call to action
mehigh 7877b24
36 - updated CSS for single product
mehigh 338e9a6
36 - copied images from ampstart travel template
mehigh 820e9d5
36 - fixed validation error
mehigh 6c468a9
Template updates.
miina fac3f4a
Merge branch 'feature/36-adventure-single' of github.com:xwp/travel i…
miina f3a1fcb
Add sticky CTA.
miina 57868cf
Fixes from review.
miina 6057eba
Fix popular posts.
miina 0c4e472
Fix popular posts.
miina 98ec3ee
Fix phpcs.
miina 6194fd3
36 - Added a class to work around the calc
mehigh 808d91f
36 - added workaround to failing calc styles
mehigh 3ea4b0a
Merge branch 'feature/36-adventure-single' of github.com:xwp/travel i…
mehigh 6c9617d
Add esc_html to address Travis issue.
kienstra bc3970c
Style fixes.
miina b945550
Merge branch 'feature/36-adventure-single' of github.com:xwp/travel i…
miina File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
<?php | ||
/** | ||
* Comments template. | ||
* | ||
* @package WPAMPTheme | ||
*/ | ||
|
||
/* | ||
* If the current post is protected by a password and | ||
* the visitor has not yet entered the password we will | ||
* return early without loading the comments. | ||
*/ | ||
if ( post_password_required() ) { | ||
return; | ||
} | ||
|
||
$reviews = wp_count_comments( get_the_ID() ); | ||
?> | ||
|
||
<div class="product-reviews"> | ||
|
||
<h2 class="mb3"><?php esc_html_e( 'Reviews', 'travel' ); ?></h2> | ||
|
||
<div class="comments wrap__item"> | ||
|
||
<?php $sort_attr = ( 'asc' === get_option( 'comment_order' ) ) ? ' sort="ascending" ' : ''; ?> | ||
<amp-live-list id="amp-live-comments-list-<?php the_ID(); ?>" class="live-list" layout="container" <?php echo $sort_attr; // WPCS: XSS OK. ?> data-poll-interval="<?php echo esc_attr( AMP_TRAVEL_LIVE_LIST_POLL_INTERVAL ); ?>" data-max-items-per-page="<?php echo esc_attr( get_option( 'page_comments' ) ? get_option( 'comments_per_page' ) : 10000 ); ?>"> | ||
<ol items class="comments__list"> | ||
<?php | ||
wp_list_comments( array( | ||
'style' => 'ol', | ||
'short_ping' => true, | ||
) ); | ||
?> | ||
</ol><!-- .comment-list --> | ||
<div update class="live-list__button"> | ||
<button class="button" on="tap:amp-live-comments-list-<?php the_ID(); ?>.update"><?php esc_html_e( 'New review(s)', 'travel' ); ?></button> | ||
</div> | ||
<nav pagination> | ||
<?php the_comments_navigation(); ?> | ||
</nav> | ||
</amp-live-list> | ||
|
||
<?php if ( ! comments_open() ) : ?> | ||
<p class="no-comments"><?php esc_html_e( 'Reviews are closed.', 'travel' ); ?></p> | ||
<?php endif; ?> | ||
|
||
<?php | ||
// Warning: If you supply title_reply_before/title_reply_after here then the comment_form_defaults filter won't be able to inject the necessary markup for AMP. | ||
comment_form(); | ||
?> | ||
|
||
</div> | ||
|
||
</div> | ||
<!-- / product-reviews --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
<?php | ||
/** | ||
* Theme footer template. | ||
* | ||
* @todo Create proper footer template(s). | ||
* @package WPAMPTheme | ||
*/ | ||
|
||
// Ignore the issues of this file since that's just a copied HTML placeholder. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Though this |
||
// @codingStandardsIgnoreFile | ||
?> | ||
<!-- Footer --> | ||
<footer class="travel-footer overflow-hidden"> | ||
|
||
<div class="relative bg-black"> | ||
|
||
<!-- Angle --> | ||
<div class="travel-footer-angle-block absolute top-0 bottom-0 right-0 xs-hide sm-hide"></div> | ||
<div class="travel-footer-angle absolute xs-hide sm-hide"></div> | ||
<!--/ Angle --> | ||
|
||
<!-- Right column --> | ||
<div class="travel-newsletter-signup"> | ||
<header class="max-width-3 mx-auto px1 md-px2"> | ||
<h4 class="travel-footer-right-column-heading travel-spacing-none h2 mb3 blue">Want travel deals<br>straight to your inbox?</h4> | ||
<div class="h4 bold mb1">Sign up to our newsletter</div> | ||
</header> | ||
<div class="relative"> | ||
<div class="travel-footer-input-bg bg-black absolute right-0 left-0 md-hide lg-hide"></div> | ||
<div class="max-width-3 mx-auto px1 md-px2 relative"> | ||
<div class="travel-input-group flex items-center col-12 rounded travel-shadow"> | ||
<input class="travel-input travel-input-big block col-12 flex-auto rounded-left" type="text" name="email" placeholder="Enter your email"> | ||
<span class="travel-input-group-sep travel-border-gray relative z1 block"></span> | ||
<button type="button" class="travel-link travel-input-big nowrap rounded-right"> | ||
Sign up now | ||
</button> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
<!--/ Right column --> | ||
|
||
<!-- Left column --> | ||
<div class="max-width-3 mx-auto px1 md-px2"> | ||
<div class="flex pt3 md-pt4 col-12 md-col-6 pr3"> | ||
<div class="col-2"> | ||
<a href="travel.amp" class="inline-block h2 line-height-1 circle white"> | ||
<svg class="travel-icon travel-icon-logo h2" viewBox="0 0 100 100"><g fill="none" fill-rule="evenodd" stroke="currentColor" stroke-width="7.5"><circle cx="50" cy="50" r="45"></circle><path d="M20.395 83.158c-2.37-10.263-.79-18.553 4.737-24.87 8.29-9.472 17.763-1.183 26.052-9.472 8.29-8.29 2.37-18.948 10.658-26.053 5.526-4.737 12.237-6.316 20.132-4.737M39.084 95c-2.788-10.2-1.912-17.304 2.627-21.316 6.808-6.017 14.956-.68 24.088-9.623 9.13-8.94 3.062-17.133 10.255-23.534 4.795-4.267 10.282-5.668 16.46-4.203"></path></g></svg> </a> | ||
</div> | ||
<div class="col-5"> | ||
<h4 class="travel-spacing-none mb2 h3 gray bold">Company</h4> | ||
<div class="line-height-4 mb4"> | ||
<a href="#" class="travel-link block gray">About</a> | ||
<a href="#" class="travel-link block gray">Careers</a> | ||
<a href="#" class="travel-link block gray">Contact</a> | ||
</div> | ||
</div> | ||
<div class="col-5"> | ||
<h4 class="travel-spacing-none mb2 h3 gray bold">Discover</h4> | ||
<div class="line-height-4 mb4"> | ||
<a href="#" class="travel-link block gray">Activities</a> | ||
<a href="#" class="travel-link block gray">Tours</a> | ||
<a href="#" class="travel-link block gray">Experiences</a> | ||
<a href="#" class="travel-link block gray">Featured Adventures</a> | ||
<a href="#" class="travel-link block gray">Search</a> | ||
</div> | ||
</div> | ||
</div> | ||
<div class="py3 gray"> | ||
© Copyright 2018 | ||
</div> | ||
</div> | ||
<!--/ Left column --> | ||
</div> | ||
</footer> | ||
<!--/ Footer --> | ||
<?php wp_footer(); ?> | ||
|
||
</section> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<?php | ||
/** | ||
* Theme header template. | ||
* | ||
* @todo Create proper header template(s). | ||
* @package WPAMPTheme | ||
*/ | ||
|
||
?> | ||
<!doctype html> | ||
<html amp <?php language_attributes(); ?>> | ||
<head> | ||
<?php wp_head(); ?> | ||
<link rel="profile" href="http://gmpg.org/xfn/11"> | ||
</head> | ||
<body <?php body_class(); ?>> | ||
|
||
<amp-state id="search_query"> | ||
<script type="application/json"> | ||
{ | ||
"search": "" | ||
} | ||
</script> | ||
</amp-state> | ||
|
||
<?php | ||
echo '<amp-state id="adventure_price"><script type="application/json">"' . esc_html( get_post_meta( get_the_ID(), 'amp_travel_price', true ) ) . '"</script></amp-state> | ||
<amp-state id="adventure_current_price"><script type="application/json">"' . esc_html( get_post_meta( get_the_ID(), 'amp_travel_price', true ) ) . '"</script></amp-state>'; | ||
?> | ||
|
||
<amp-state id="fields_query"><script type="application/json">""</script></amp-state> | ||
<amp-state id="query_query"><script type="application/json">""</script></amp-state> | ||
|
||
<section class="travel-main-wrapper overflow-hidden" role="main"> | ||
|
||
<!-- Results Navbar --> | ||
<header class="travel-results-navbar pt4 pr4 pl4"> | ||
<div class="px1 md-px2 flex justify-between items-stretch"> | ||
<div class="flex items-stretch"> | ||
<a href="travel.amp" class="travel-results-navbar-icon h2 circle my1 md-my2"> | ||
<svg class="travel-icon travel-icon-logo h2" viewBox="0 0 100 100"><g fill="none" fill-rule="evenodd" stroke="currentColor" stroke-width="7.5"><circle cx="50" cy="50" r="45"></circle><path d="M20.395 83.158c-2.37-10.263-.79-18.553 4.737-24.87 8.29-9.472 17.763-1.183 26.052-9.472 8.29-8.29 2.37-18.948 10.658-26.053 5.526-4.737 12.237-6.316 20.132-4.737M39.084 95c-2.788-10.2-1.912-17.304 2.627-21.316 6.808-6.017 14.956-.68 24.088-9.623 9.13-8.94 3.062-17.133 10.255-23.534 4.795-4.267 10.282-5.668 16.46-4.203"></path></g></svg> </a> | ||
</div> | ||
</div> | ||
</header> | ||
<!--/ Results Navbar --> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is outside this PR's diff, but could you please add
'comments'
to the'adventure'
CPT'supports'
argument? I think this is blocking the "Popular Adventures" block from displaying, as you can't add ratings (comments) to the 'adventure' post type.