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 wpse_filter_child_cats( $query ) { | |
if ( $query->is_category ) { | |
$queried_object = get_queried_object(); | |
$child_cats = (array) get_term_children( $queried_object->term_id, 'category' ); | |
if ( ! $query->is_admin ) | |
//exclude the posts in child categories |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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 post_ID = $('#post_ID').val(), | |
parent_id = ( '' == $('#parent_id').val() ) ? 0 : $('#parent_id').val(), | |
addNew = $('.add-new-h2'), | |
html = ''; | |
html += ' <a id="add_new_sibling" href="post-new.php?post_type=' + typenow + '&parent_id=' + parent_id + '" class="add-new-h2" target="_blank">' + quick_add_child_js_params.add_new_sibling + '</a>'; | |
html += '<a id="add_new_child" href="post-new.php?post_type=' + typenow + '&parent_id=' + post_ID + '" class="add-new-h2" target="_blank">' + quick_add_child_js_params.add_new_child + '</a>'; |
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 my_list_categories( $output, $args ) { | |
$pattern = '/(<a.*?>)/'; | |
$replacement = '$1<i class="ico-my"></i> '; | |
return preg_replace( $pattern, $replacement, $output ); | |
} | |
add_filter( 'wp_list_categories', 'my_list_categories', 10, 2 ); |
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 sp_wp_default_styles($styles) | |
{ | |
//use our app version constant | |
$styles->default_version = SCHOOLPRESS_VERSION; | |
} | |
add_action("wp_default_styles", "sp_wp_default_styles"); |
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
<h1>{{post.title}}</h1> | |
{{post.content}} |
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
<h1>{{post.title}}</h1> | |
<div ng-bind-html="post.content"></div> |
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
<h1>{{post.title}}</h1> | |
<div ng-bind-html="post.content | toTrusted"></div> |
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
<search-form></search-form> | |
<ul> | |
<li ng-repeat="post in posts"> | |
<a href="{{post.ID}}" ng-bind-html="post.title"></a> | |
<div ng-bind-html="post.content"></div> | |
</li> | |
</ul> |
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
//Main controller | |
app.controller('Main', ['$scope', '$http', function(a, b) { | |
b.get('wp-json/posts/').success(function(res){ | |
a.posts = res; | |
}); | |
}]); |
OlderNewer