This file contains hidden or 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 | |
foreach ($obj as $key => $value) { | |
echo "$key => $value\n"; | |
} |
This file contains hidden or 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 | |
/* | |
To change the location of the wp-content is quite simple as the location of this folder | |
can be configured in your wp-config.php file. One thing to note is that you need to add | |
these new constant variable above the line where WordPress includes the wp-settings.php. | |
*/ | |
// All you have to do is add a new variable WP_CONTENT_DIR and change the location of your wp-content folder. | |
define( 'WP_CONTENT_DIR', $_SERVER['DOCUMENT_ROOT'] . '/blog/content/wp-content' ); | |
// To change the location of the wp-content URL there is another variable you can define in the wp-config. | |
define( 'WP_CONTENT_URL', 'http://www.paulund.co.uk/blog/content/wp-content' ); |
This file contains hidden or 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 this to your themes functions.php file | |
// change login image | |
add_action("login_head", "tmx_login_head"); | |
function tmx_login_head() { | |
echo " | |
<style> | |
body.login #login h1 a { | |
background: url('".get_header_image()."') no-repeat scroll center top transparent; | |
height: ".get_custom_header()->height."px; |
This file contains hidden or 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 | |
/* | |
This is optimized for archive.php and archive-{posttype}.php template files for displaying the title of the post type. | |
Usage: | |
<?php post_type_archive_title( $prefix, $display ); ?> | |
Parameters: | |
$prefix | |
(string) (optional) What to display before the title | |
Default: None | |
$display |
This file contains hidden or 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
/* | |
Method 1: Reset | |
*/ | |
$('#create-user-form')[0].reset(); | |
// or | |
$('#create-user-form').get(0).reset() | |
// or inline | |
<input type="button" onclick="this.form.reset();"> | |
/* |
This file contains hidden or 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
bootbox.dialog({ | |
title: "This is a AJAX Form from external file.", | |
data: {'user':'dc','task':'get'}, | |
datauri: 'ajax.html', | |
buttons: { | |
success: { | |
label: "Save", | |
className: "btn-success", | |
callback: function () { | |
var name = $('#name').val(); |
This file contains hidden or 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 | |
/* | |
Pattern: string ini_set ( string $varname , string $newvalue ) | |
Documentation: http://php.net/manual/en/function.ini-set.php | |
*/ | |
echo ini_get('display_errors'); | |
if (!ini_get('display_errors')) { | |
ini_set('display_errors', '1'); | |
} |
This file contains hidden or 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
/* | |
Chrome appears to render pixelated images in the same way that Firefox and Safari will render images with crisp-edges. | |
Reference: | |
https://css-tricks.com/almanac/properties/i/image-rendering | |
https://developer.mozilla.org/en/docs/Web/CSS/image-rendering | |
*/ | |
img { | |
image-rendering: auto; | |
image-rendering: crisp-edges; |
This file contains hidden or 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
/* | |
This is useful in situations where you want to provide an easier/cleaner | |
copy-paste experience for users (not have them accidentally text-select | |
useless things, like icons or images). However it's a bit buggy. Firefox enforces | |
the fact that any text matching that selector cannot be copied. WebKit still | |
allows the text to be copied if you select elements around it. | |
Reference: https://css-tricks.com/almanac/properties/u/user-select | |
*/ | |
.row-of-icons { | |
-webkit-user-select: none; /* Chrome all / Safari all */ |
This file contains hidden or 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
/* | |
On mobile devices, the text-size-adjust property allows Web authors to control if and how | |
the text-inflating algorithm is applied to the textual content of the element it is applied to. | |
As this property is non-standard, it must be used prefixed: -moz-text-size-adjust, | |
-webkit-text-size-adjust, and -ms-text-size-adjust. | |
Reference: | |
http://blog.55minutes.com/2012/04/iphone-text-resizing | |
http://davemacaulay.com/webkit-text-size-adjust-doesnt-work-on-android-chrome | |
*/ |