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 | |
$results = $wpdb->get_results( | |
$wpdb->prepare(" | |
SELECT ID, post_title, post_name, post_parent | |
FROM $wpdb->posts | |
WHERE post_parent IN (".implode(',', array_map('intval', $post_ids)).") | |
") | |
); |
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 | |
/** | |
* The main template file. | |
* | |
* This is the most generic template file in a WordPress theme and one of the | |
* two required files for a theme (the other being style.css). | |
* It is used to display a page when nothing more specific matches a query. | |
* For example, it puts together the home page when no home.php file exists. | |
* | |
* Learn more: http://codex.wordpress.org/Template_Hierarchy |
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 for front-end requests | |
if (!is_admin() && !is_feed()) { | |
add_filter('parse_request', 'my_add_posts_per_page'); | |
} | |
// add our condition-checking filter | |
function my_add_posts_per_page() { | |
add_filter('pre_get_posts', 'my_posts_per_page'); |
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 | |
global $wpdb; | |
$keys = $wpdb->get_col(" | |
SELECT DISTINCT meta_key | |
FROM $wpdb->postmeta | |
"); | |
foreach ($keys as $key) { |
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
{ | |
{I have|I've} been {surfing|browsing} online more than {three|3|2|4} hours today, yet I never found any interesting article like yours. {It's|It is} pretty worth enough for me. {In my opinion|Personally|In my view}, if all {webmasters|site owners|website owners|web owners} and bloggers made good content as you did, the {internet|net|web} will be {much more|a lot more} useful than ever before.| | |
I {couldn't|could not} {resist|refrain from} commenting. {Very well|Perfectly|Well|Exceptionally well} written!| | |
{I will|I'll} {right away|immediately} {take hold of|grab|clutch|grasp|seize|snatch} your {rss|rss feed} as I {can not|can't} {in finding|find|to find} your {email|e-mail} subscription {link|hyperlink} or {newsletter|e-newsletter} service. Do {you have|you've} any? {Please|Kindly} {allow|permit|let} me {realize|recognize|understand|recognise|know} {so that|in order that} I {may just|may|could} subscribe. Thanks.| | |
{It is|It's} {appropriate|perfect|the best} time to make some plans for the future and {it is|i |
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
jQuery(function($) { | |
$('#menu-pages > a[href="edit.php?post_type=page"]') | |
.attr('href', 'edit.php?post_type=page&page=cf-admin-column-view-page'); | |
}) |
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
// Vars - note the quotes around comma separated selectors | |
$a-tags: 'a, a:active, a:hover, a:visited'; | |
$a-tags-hover: 'a:active, a:hover'; | |
// Usage | |
#{$a-tags} { | |
color: red; | |
font-size: 1em; | |
text-decoration: none; | |
} |
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
[alias] | |
up = "pull --rebase" | |
pullmerge = "pull --no-rebase" | |
subup = "!f() { git submodule sync; git submodule update --init --recursive; }; f" | |
subreset = "submodule foreach 'git reset --hard HEAD'" | |
who = shortlog -s -- | |
lg = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative | |
info = remote -v | |
incoming = !(git fetch --quiet && git log --pretty=format:'%C(yellow)%h %C(white)- %C(red)%an %C(white)- %C(cyan)%d%Creset %s %C(white)- %ar%Creset' ..@{u}) | |
outgoing = !(git fetch --quiet && git log --pretty=format:'%C(yellow)%h %C(white)- %C(red)%an %C(white)- %C(cyan)%d%Creset %s %C(white)- %ar%Creset' @{u}..) |
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 | |
$feed = fetch_feed('https://github.com/alexkingorg.atom'); | |
// some activity isn't interesting enough to output | |
$ignore_types = array( | |
'issue_comment', | |
'watch', | |
); |