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
/** | |
* Get Page ID by Template Name | |
* @param {string} full filename of template (e.g., full-width.php) | |
* @return {array} IDs of pages assigned the template | |
*/ | |
function ac_get_id_by_template($templateName) { | |
$args = array( | |
'post_type' => 'page', | |
'fields' => 'ids', | |
'nopaging' => true, |
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
<?php | |
/** | |
* Autoloader Class | |
* | |
* This class is responsible for loading all the requested class of the | |
* system | |
* | |
* @author Time.ly Network, Inc. | |
* @since 2.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
(function() { | |
"use strict"; | |
function doAjax(counter, callback) { | |
var attempt = counter || 0; | |
var retryLimit = 2; | |
jQuery.ajax({ | |
type: 'GET', | |
url: '', |
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
(function(){ | |
"use strict"; | |
var ajaxRequest = null; | |
/** | |
* Abort in-progress AJAX request | |
*/ | |
function abortAjax() { | |
if (ajaxRequest && ajaxRequest.readyState != 4) { |
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
function recursiveAjax(currPage, callback) { | |
var currPage = currPage || 1; | |
jQuery.ajax({ | |
type : 'GET', | |
url : '', | |
dataType : 'json', | |
data : { | |
page : currPage | |
} |
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
<?php | |
function ac_sort_buttons() { | |
echo '<p>'; | |
echo 'Sort:'; | |
echo '<a href="?sort=oldest">Oldest</a>'; | |
echo '<a href="?sort=alpha">Alphabetical</a>'; | |
echo '<a href="?sort=random">Random</a>'; | |
echo '<a href="?sort=all">Show All</a>'; | |
echo '</p>'; |