Specifying Image Size (e.g. using double resolution images for retina displays) .header_logo {background-image: url(images/header_logo.png);background-size: 260px 55px;width: 260px;height: 55px;border: none;} Adding an image (e.g. an icon) to the left of some text Cropping overflow: hidden; Curved Corners border-radius: 4px 4px 4px 4px; Specifying Image Class <a href=”school_home.php”><img class=”my_thumb_class” src=”a.png” ></a> img.my_thumb_class { Floating An Image Over […]
All posts by
.Useful CSS
Setting style <div class="style1"> <div style="color:#FF0000"> <span style="color:#FF0000">colored</span> Size width: 100%; height: 20px; Padding padding: 2px; (All) padding-top: 2px; padding-right: 2px; padding-bottom: 2px; padding-left: 2px; Margin margin: 2px; (All) margin: 1px 2px; (Top+Bottom, Right+Left) margin: 1px 2px 3px; (Top, Right+Left, Bottom) margin: 1px 2px 3px 4px; (Top, Right, Bottom, Left) margin-top: 2px; margin-right: 2px; margin-bottom: […]
Site Root
You can’t do this in php: require_once ‘/s3_settings.php’; So instead do this: require_once($_SERVER[‘DOCUMENT_ROOT’] . ‘/s3_settings.php’);
Upload A Server File
This uses an old aws method Upload A Saved File $upload_file = if (file_exists($upload_file)) { try { $options = array('key' => $s3_accesskey, 'secret' => $s3_secretkey); $s3 = new AmazonS3($options); //Upload file $response = $s3->create_object($s3_thumbnails_bucket, basename($upload_file), array( 'fileUpload' => $upload_file, //'storage' => AmazonS3::STORAGE_REDUCED, 'acl' => AmazonS3::ACL_PUBLIC )); if ($response->isOK()) echo "Upload success"; else echo "Upload failed"; […]
Line Break
<br />
Die
die(“Unable to connect to $site”);
Adding Buttons To The HTML Editor
This post describes how to do it: http://myownhomeserver.com/2011/10/wordpress-addremove-quicktags-simple-editor-buttons-in-3-3/
Using WordPress Dev Javascript
WordPress minifies the core javascript files. For instance it uses editor.js instead of the original source code file editor.dev.js. You can’t just rename the .dev.js files as the minifying also changes things such as variable names. However you can tell wordpress to use the dev.js files instead by adding this to wp-config.php (before any requires): define(‘SCRIPT_DEBUG’, true);
Include css file in another css file
You can use this within a css file to include another css file: @import url(“/css/another_style.css”);
Rename Object
You can’t rename objects in S3, you have to copy them to a new object name and then delete the original //—– SET THE FILE NAME EXTENSION TO MATCH THE USER UPLOADED FILE —– require_once ‘my_sdk_files_path/sdk.class.php’; //<<<<SET THIS $s3 = new AmazonS3(); $bucket = “my_bucket_name”; //<<<<SET THIS //GET THE USERS FILENAME EXTENSION $filename_extension = pathinfo($uploaded_source_file_name, […]