-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Michel Moraes
committed
Sep 18, 2018
1 parent
aac4bf3
commit 6c9fd94
Showing
18 changed files
with
225 additions
and
79 deletions.
There are no files selected for viewing
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,60 @@ | ||
<?php | ||
|
||
// Register Custom Post Type Tour | ||
// Post Type Key: tour | ||
function create_tour_cpt() { | ||
|
||
$labels = array( | ||
'name' => __( 'Tours', 'Post Type General Name', 'base-camp' ), | ||
'singular_name' => __( 'Tour', 'Post Type Singular Name', 'base-camp' ), | ||
'menu_name' => __( 'Tours', 'base-camp' ), | ||
'name_admin_bar' => __( 'Tour', 'base-camp' ), | ||
'archives' => __( 'Tour Archives', 'base-camp' ), | ||
'attributes' => __( 'Tour Attributes', 'base-camp' ), | ||
'parent_item_colon' => __( 'Parent Tour:', 'base-camp' ), | ||
'all_items' => __( 'All Tours', 'base-camp' ), | ||
'add_new_item' => __( 'Add New Tour', 'base-camp' ), | ||
'add_new' => __( 'Add New', 'base-camp' ), | ||
'new_item' => __( 'New Tour', 'base-camp' ), | ||
'edit_item' => __( 'Edit Tour', 'base-camp' ), | ||
'update_item' => __( 'Update Tour', 'base-camp' ), | ||
'view_item' => __( 'View Tour', 'base-camp' ), | ||
'view_items' => __( 'View Tours', 'base-camp' ), | ||
'search_items' => __( 'Search Tour', 'base-camp' ), | ||
'not_found' => __( 'Not found', 'base-camp' ), | ||
'not_found_in_trash' => __( 'Not found in Trash', 'base-camp' ), | ||
'featured_image' => __( 'Featured Image', 'base-camp' ), | ||
'set_featured_image' => __( 'Set featured image', 'base-camp' ), | ||
'remove_featured_image' => __( 'Remove featured image', 'base-camp' ), | ||
'use_featured_image' => __( 'Use as featured image', 'base-camp' ), | ||
'insert_into_item' => __( 'Insert into Tour', 'base-camp' ), | ||
'uploaded_to_this_item' => __( 'Uploaded to this Tour', 'base-camp' ), | ||
'items_list' => __( 'Tours list', 'base-camp' ), | ||
'items_list_navigation' => __( 'Tours list navigation', 'base-camp' ), | ||
'filter_items_list' => __( 'Filter Tours list', 'base-camp' ), | ||
); | ||
$args = array( | ||
'label' => __( 'Tour', 'base-camp' ), | ||
'description' => __( 'Tours', 'base-camp' ), | ||
'labels' => $labels, | ||
'menu_icon' => 'dashicons-location-alt', | ||
'supports' => array('title', 'editor', 'thumbnail', 'revisions', 'trackbacks', 'page-attributes', ), | ||
'taxonomies' => array(), | ||
'public' => true, | ||
'show_ui' => true, | ||
'show_in_menu' => true, | ||
'menu_position' => 10, | ||
'show_in_admin_bar' => true, | ||
'show_in_nav_menus' => true, | ||
'can_export' => true, | ||
'has_archive' => false, | ||
'hierarchical' => false, | ||
'exclude_from_search' => false, | ||
'show_in_rest' => true, | ||
'publicly_queryable' => true, | ||
'capability_type' => 'page', | ||
); | ||
register_post_type( 'tour', $args ); | ||
|
||
} | ||
add_action( 'init', 'create_tour_cpt', 0 ); |
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
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
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
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
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,30 @@ | ||
|
||
<div class="section-tours__cards"> | ||
|
||
<slick ref="slick" :options="slickOptions"> | ||
|
||
{% for tour in tours %} | ||
|
||
{% set tour_featured_image = TimberImage(tour.thumbnail) %} | ||
|
||
<div class="column"> | ||
<a href="{{ tour.link }}"> | ||
<div class="section-tours__card"> | ||
<div class="section-tours__header" | ||
style="background-image: url('{{ tour_featured_image.src|resize(640)}}')"> | ||
<div class="section-tours__card-title">{{ tour.title }}</div> | ||
</div> | ||
<div class="section-tours__footer"> | ||
<div class="section-tours__card-copy">It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout.</div> | ||
<a href="{{ tour.link }}" class=" section-tours__card-cta">Read More</a> | ||
</div> | ||
</div> | ||
</a> | ||
</div> | ||
|
||
{% endfor %} | ||
|
||
</slick> | ||
|
||
</div> | ||
<div class="slick__dots"></div> |
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,37 @@ | ||
{% extends "base.twig" %} | ||
|
||
{% block content %} | ||
|
||
<section class="section"> | ||
<div class="container"> | ||
|
||
<div class="columns is-desktop"> | ||
<div class="column is-three-fifths-desktop"> | ||
<article class="single-tour__content content"> | ||
|
||
{% if tour_gallery %} | ||
<slick ref="slick" :options="slickOptionsTour"> | ||
|
||
{% for image in tour_gallery %} | ||
<img src="{{ image.url }}" alt="{{ image.alt}}"> | ||
{% endfor %} | ||
|
||
</slick> | ||
<div class="slick__dots"></div> | ||
{% endif %} | ||
|
||
<h2 class="">{{ post.full_title}}</h2> | ||
{{ post.content }} | ||
</article> | ||
</div> | ||
<div class="column"> | ||
<div class="single-tour__sidebar has-text-centered"> | ||
{{ post.book_iframe_code }} | ||
</div> | ||
</div> | ||
</div> | ||
|
||
</div> | ||
</section> | ||
|
||
{% endblock %} |
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,11 @@ | ||
{% extends "base.twig" %} | ||
|
||
{% block content %} | ||
|
||
<section class="section-tours section" id="post-{{ post.ID }}"> | ||
<div class="container"> | ||
{% include 'partials/tours-carousel.twig' %} | ||
</div> | ||
</section> | ||
|
||
{% endblock %} |
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
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
static/js/app.4a7e01efaf89bcf71b1f.js → static/js/app.3e9ac7714c1d128be36f.js
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
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 |
---|---|---|
@@ -1,10 +1,12 @@ | ||
{ | ||
"admin.css": "css/admin.4a7e01efaf89bcf71b1f.css", | ||
"admin.js": "js/admin.4a7e01efaf89bcf71b1f.js", | ||
"app.css": "css/app.4a7e01efaf89bcf71b1f.css", | ||
"app.js": "js/app.4a7e01efaf89bcf71b1f.js", | ||
"login.css": "css/login.4a7e01efaf89bcf71b1f.css", | ||
"login.js": "js/login.4a7e01efaf89bcf71b1f.js", | ||
"vendor.js": "js/vendor.4a7e01efaf89bcf71b1f.js", | ||
"admin.css": "css/admin.3e9ac7714c1d128be36f.css", | ||
"admin.js": "js/admin.3e9ac7714c1d128be36f.js", | ||
"app.css": "css/app.3e9ac7714c1d128be36f.css", | ||
"app.js": "js/app.3e9ac7714c1d128be36f.js", | ||
"login.css": "css/login.3e9ac7714c1d128be36f.css", | ||
"login.js": "js/login.3e9ac7714c1d128be36f.js", | ||
"vendor.js": "js/vendor.3e9ac7714c1d128be36f.js", | ||
"images/icon-cart-white.png": "images/icon-cart-white.png", | ||
"images/texture-blue-carnival.jpg": "images/texture-blue-carnival.jpg", | ||
"images/base-camp-logo.png": "images/base-camp-logo.png" | ||
} |
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,20 @@ | ||
<?php | ||
/* | ||
* Template Name: Tours | ||
*/ | ||
|
||
$context = Timber::get_context(); | ||
$post = new TimberPost(); | ||
$context['post'] = $post; | ||
|
||
$args = array( | ||
'post_type' => 'tour', | ||
'posts_per_page' => -1, | ||
'orderby' => array( | ||
'date' => 'DESC' | ||
) | ||
); | ||
|
||
$context['tours'] = Timber::get_posts( $args ); | ||
|
||
Timber::render('template-tours.twig', $context); |