The popular open-source contract for web designers and developers by Stuff & Nonsense
- Originally published: 23/12/2008
- Revised date: 15/12/2013
- Original post
/* =BEGIN: Check If Page Is Child | |
Source: http://bavotasan.com/2011/is_child-conditional-function-for-wordpress/ | |
---------------------------------------------------------------------------------------------------- */ | |
function is_child( $page_id_or_slug ) { // $page_id_or_slug = The ID of the page we're looking for pages underneath | |
global $post; // load details about this page | |
if ( !is_numeric( $page_id_or_slug ) ) { // Used this code to change a slug to an ID, but had to change is_int to is_numeric for it to work. | |
$page = get_page_by_path( $page_id_or_slug ); | |
$page_id_or_slug = $page->ID; | |
} |
/* iPhone 6 landscape */ | |
@media only screen and (min-device-width: 375px) | |
and (max-device-width: 667px) | |
and (orientation: landscape) | |
and (-webkit-min-device-pixel-ratio: 2) | |
{ } | |
/* iPhone 6 portrait */ | |
@media only screen | |
and (min-device-width: 375px) |
@media only screen and (max-width: 480px), only screen and (max-device-width: 480px), only screen and (max-device-height:480px){ | |
.mktoForm,.mktoForm *{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;-moz-box-sizing:border-box;padding:auto} | |
/* Yes, I know padding:auto isn't a real property - had to break things somehow :( */ | |
.mktoLabel.mktoHasWidth {height: inherit !important;} | |
.mktoForm .mktoGutter,.mktoForm .mktoOffset{display:initial !important} | |
.mktoForm .mktoFormCol .mktoLabel{text-align:left;width:initial !important} | |
.mktoForm .mktoFormCol{float:initial !important} | |
.mktoForm .mktoFieldWrap{float:initial !important} | |
.mktoForm fieldset{padding:initial !important} | |
.mktoForm input[type=url],.mktoForm input[type=text],.mktoForm input[type=date],.mktoForm input[type=tel],.mktoForm input[type=email],.mktoForm input[type=number],.mktoForm textarea.mktoField,.mktoForm select.mktoField{width:100% !important;height:initial !important;line-height:initial !important;font-size:initial !i |
<pre><?php | |
// WordPress - Delete all revisions from all posts greater than 1 year old. | |
// Credit to @mrazzari, 2014. | |
// For context see this thread started by Kitchin at the forums: | |
// http://wordpress.org/support/topic/deleting-post-revisions-do-not-use-the-abc-join-code-you-see-everywhere | |
// HOWTO | |
// This snippet is meant to be called as a standalone script. | |
// Like http://example.com/tmp/wp_delete_revisions.php |