Last active
August 10, 2017 12:12
-
-
Save imbdev/cfee340839b43a9e537e04117666ba7e to your computer and use it in GitHub Desktop.
VUE JS PRAISE LOOP
This file contains hidden or 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
<!--======================================== | |
= Normal Praise Loop = | |
=========================================--> | |
<section id="normal-praise-loop" class="container"> | |
<main class="container"> | |
<div class="flex-container"> | |
<article class="text-box flex-item text-center" v-for="post in posts"> | |
<figure> | |
<img class="img-responsive img-circle center-block" :src="post.acf.client_image" alt=""> | |
<!-- <img class="img-responsive img-circle center-block" src="/wp-content/uploads/2017/07/Sharee-Moore-150x150.jpg" alt=""> --> | |
</figure> | |
<h4 class="subheading"> {{ post.acf.client_description }} </h4> | |
<h2 class="heading">{{ post.title.rendered }} </h2> | |
<!-- <h2 class="heading">Sharee Moore </h2> --> | |
<p class="praise-text"> | |
{{ post.acf.client_content }} | |
<!-- Tiana has been my business coach for the past 8 months. She is one of those leaders with the "inside edge" ... she stays current on the latest strategies for growing my list of clientele, increasing sales and delivering high quality customer service. If you're looking for a social media expert who can increase your bottom line - you're in luck! Your search has ended. Thank you Tiana! --> | |
</p> | |
</article> | |
</div> | |
<div class="load-more-btn-box row text-center hide"> | |
<a class="btn btn-success btn-lg" href="#">LOAD MORE</a> | |
</div> | |
</main> | |
</section> <!-- End Container --> | |
<!--==== End of Normal Praise Loop ====--> | |
<script type="text/javascript"> | |
new Vue ({ | |
el: '#normal-praise-loop', | |
data: { | |
ajax: '<?php echo get_site_url(); ?>', | |
posts: '', | |
}, | |
created: function() { | |
this.getNews(); | |
}, | |
methods: { | |
getNews: function() { | |
var app = this; | |
// axios.get( app.ajax + '/wp-json/wp/v2/posts?categories=5&per_page=100') | |
// axios.get( app.ajax + '/wp-json/wp/v2/posts?per_page=100') | |
axios.get( app.ajax + '/wp-json/wp/v2/testimonials-api?per_page=100') | |
.then(function(response) { | |
app.posts = response.data; | |
return app.posts; | |
}) | |
.catch(function(error){ | |
console.log(error); | |
}); | |
}, | |
} | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment