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
// Add data to HTML according to object´s property name | |
function addContentFromDataToHtml(object, dataSet) { | |
recursiveObject({object: object, callback: addContentFromDataToHtmlCallback, dataSet: dataSet}); | |
} | |
function recursiveObject(recursiveParams) { | |
if (recursiveParams.parentsItem) { | |
recursiveParams.parentsItem = recursiveParams.parentsItem+'.'; | |
} else { | |
recursiveParams.parentsItem = ''; | |
} |
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 | |
add_filter( 'the_content', 'crd_append_post_links' ); | |
function crd_append_post_links( $content ) { | |
if ( is_page() ) { | |
$post_links_data = get_post_meta( get_the_ID() ); | |
if ( isset( $post_links_data[ 'blog_group' ][ 0 ] ) ) { | |
$blog_list = maybe_unserialize( $post_links_data[ 'blog_group' ][ 0 ] ); | |
$posts_list = '<ul>'; | |
foreach ( $blog_list as $post_info ) { |
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 | |
/** | |
* @package Custom_queries | |
* @version 1.0 | |
*/ | |
/* | |
Plugin Name: Custom queries | |
Plugin URI: http://wordpress.org/extend/plugins/# | |
Description: This is an example plugin | |
Author: Carlo Daniele |
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
/** | |
* returns taxonomy lists that have children with checkboxes | |
* | |
*/ | |
function get_subject_list($taxonomy){ | |
// Sets the taxonomy to pull a list of terms from. | |
// Throws them into a nifty object for referencing and counting | |
$terms = get_terms($taxonomy,array('parent' => 0)); | |
if ($terms) { |
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
Total props to Brian Cray: http://briancray.com/posts/estimated-reading-time-web-design/ |