Skip to content

Instantly share code, notes, and snippets.

Jake Bown jakerb

View GitHub Profile
@jakerb
jakerb / function.php
Created Feb 13, 2019
Add children to Post Object
View function.php
<?php
function add_children_to_pages($response) {
foreach($response['posts'] as $index => $post) {
$args = array(
'post_type' => 'app_pages',
'posts_per_page' => -1,
'post_parent' => $post->ID,
View functions.php
<?php
$args = array(
'post_type' => 'app_pages',
'posts_per_page' => -1,
'orderby' => 'title',
'order' => 'ASC'
);
$app_pages = new WP_Query( $args );
@jakerb
jakerb / main.js
Created Jan 29, 2019
Unwrap template includes
View main.js
/**
* Provide some Javascript to be included within your application.
*
* @link https://myappuccino.com/
* @since 1.0.0
*
* @package Appuccino
*/
@jakerb
jakerb / blog_article.php
Created Sep 14, 2018
MyAppuccino Article template.
View blog_article.php
<!-- Include the header file -->
<div ng-include="app.app.base_url + 'partials/header.html'"></div>
<!-- Include the header file -->
<div class="page-has-header page-has-footer">
<h2 ng-bind="data.blog_posts[params.pid].post_title"></h2>
<p class="uk-text-meta">Posted <span ng-bind="data.blog_posts[params.pid].post_date"></span></p>
<p ng-bind="data.blog_posts[params.pid].post_content"></p>
@jakerb
jakerb / blog_posts.php
Created Sep 14, 2018
MyAppuccino Blog Post template with links to article
View blog_posts.php
<!-- Include the header file -->
<div ng-include="app.app.base_url + 'partials/header.html'"></div>
<!-- Include the header file -->
<div class="page-has-header page-has-footer">
<div uk-slider="center: true">
<div class="uk-position-relative uk-visible-toggle uk-light">
<ul class="uk-slider-items uk-child-width-1-1 uk-grid">
@jakerb
jakerb / blog_article.php
Created Sep 14, 2018
A blog article page in a MyAppuccino template.
View blog_article.php
<!-- Include the header file -->
<div ng-include="app.app.base_url + 'partials/header.html'"></div>
<!-- Include the header file -->
<div class="page-has-header page-has-footer">
<h2>You are reading article <span ng-bind="params.pid"></span></h2>
</div>
@jakerb
jakerb / script.js
Created Sep 14, 2018
Pass parameters as params into the scope.
View script.js
(function() {
if (typeof $appuccino !== 'undefined') {
/*
* application/controller
* @info Fired when the application controller is ready.
*
* Read more about hooks in App Docs.
* @link https://dashboard.myappuccino.com/documentation/app/
@jakerb
jakerb / blog_posts.php
Created Sep 14, 2018
List blog posts as cards in MyAppuccino app.
View blog_posts.php
<!-- Include the header file -->
<div ng-include="app.app.base_url + 'partials/header.html'"></div>
<!-- Include the header file -->
<div class="page-has-header page-has-footer">
<div uk-slider="center: true">
<div class="uk-position-relative uk-visible-toggle uk-light">
<ul class="uk-slider-items uk-child-width-1-1 uk-grid">
@jakerb
jakerb / functions.php
Last active Sep 14, 2018
Add posts to MyAppuccino response.
View functions.php
<?php
function mya_response_blog_posts($response) {
/*
* Get 10 posts with the type 'post'
* that are set as published.
*/
$posts = get_posts(array(
'post_type' => 'post',
'post_status' => 'publish',
@jakerb
jakerb / uikit-queries.js
Last active Feb 12, 2018
A simple UIkit component for toggling classes at breakpoints.
View uikit-queries.js
/*
* UIkit Queries
* Requires jQuery.
* Built by @jakebown1
* -------------------------------
* UIkit.component('hello', __caller(<min-width>, <max-width>);
* -------------------------------
* <div uk-hello="my_class"></div>
*/
You can’t perform that action at this time.