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
| <?php | |
| $list = $page->children()->paginate(10); | |
| $pagination = $list->pagination(); | |
| ?> | |
| <ul> | |
| <?php foreach($list as $item): ?> | |
| <li><!-- item html --></li> |
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
| <?php | |
| if(!r::is_ajax()) notFound(); | |
| header('Content-type: application/json; charset=utf-8'); | |
| $data = $pages->find('blog')->children()->visible()->paginate(10); | |
| $json = array(); |
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
| /* Loop | |
| <?php while(get_child()): ?> | |
| // links, img, custom fields | |
| <?php endwhile; ?> | |
| */ | |
| /* Function */ | |
| function get_child($original='') { | |
| if( ! Registry::has('page_original')) { | |
| Registry::set('page_original', $original); |
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
| /* | |
| <?php while(mytheme_page_children()): ?> | |
| <?php echo page_title(); ?> | |
| <?php endwhile; ?> | |
| */ | |
| function mytheme_page_children() { | |
| if( ! Registry::has('page_original')) { |
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
| <div class="bg-header" | |
| <?php | |
| /* | |
| This is to show a custom field from an article. | |
| It will need to be created in the metadata section before it can be used in the post edit area. | |
| In this case the custom field will need to be called 'image' and be set as an image custom field in the dropdown for type. | |
| */ | |
| $image = article_custom_field('image'); // Applying a variable to the custom field, so it can be reused with ease | |
| if ( !empty($image) ) : // Check if the field is empty, if it is the process stops here |
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
| <?php | |
| /* | |
| This is to show a custom field from an article. | |
| It will need to be created in the metadata section before it can be used in the post edit area. | |
| In this case the custom field will need to be called 'image' and be set as an image custom field in the dropdown for type. | |
| */ | |
| $image = article_custom_field('image'); // Applying a variable to the custom field, so it can be reused with ease | |
| if ( !empty($image) ) : // Check if the field is empty, if it is the process stops here | |
| ?> | |
| <figure> |
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
| <?php | |
| // allowCat contains all catergory ID that you want on your page | |
| $allowCat = array(2,3,4,5,6); | |
| function article_category_id() { | |
| if($category = Registry::prop('article', 'category')) { | |
| $categories = Registry::get('all_categories'); | |
| return $categories[$category]->id; | |
| } |
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
| #!/bin/bash | |
| # | |
| # Install script for quick static site | |
| # Source : https://github.com/stevedev/html_template | |
| # | |
| curl -L http://github.com/stevedev/html_template/zipball/master > stevedev-html_template.zip | |
| unzip stevedev-html_template.zip | |
| rm -fr stevedev-html_template.zip | |
| mv stevedev-html_template* newsite |