How to unsubscribe from spam e-mails?
With 2012 just round the corner, you might be planning on being efficient with the time you spend in your inbox in 2012. If that’s the case, today’s post should prove helpful! In this...
With 2012 just round the corner, you might be planning on being efficient with the time you spend in your inbox in 2012. If that’s the case, today’s post should prove helpful! In this...
It was only time that kept bloggers around the world from writing their comparisons of the three major Content Management Systems (WordPress, Joomla and Drupal) – and that time is finally up. People everywhere...
Download themes for CMS Made Simple, you can use with the Theme Manager. These themes are uploaded here are contributed by independant third parties as a free service. The CMS Made Simple project make...
To Target Specific Browsers: #ID or .class is like div#main or div.main * html #ID or .class { ie6 } NOTE: sometimes IE6 requires… * html body #ID or .class { ie6 } *:first-child+html #ID or .class { ie7 } #ID...
Many of us want minor tweaks, here and there for the various modules we use on our website(s), and occasionaly to the core. Sometimes those tweaks aren’t so minor. Many of you have been...
I wanted to have articles edited only by the ones who create them (Author) and provide the Author a way to manually allow additional authors to edit the article. As the goal of this...
The issue is 1) custom fonts are awesome and we want to use them 2) custom fonts slow down our pages by being large additional resources. Dealing with this has been in the air...
PHP add_filter( ‘use_default_gallery_style’, ‘__return_false’ ); Reference URL
There is no CSS for applying an underline (text-decoration: underline;) only to individual words in a multiple-word element. The best way would be to wrap each word in a span (not the spaces, just...
Comment out the top line there, and add the rest to your wp-config.php file to get more detailed error reporting from your WordPress site. Definitely don’t do this live, do it for local development and testing....
Setting Single Attribute $(“img”).attr(“src”, “/images/banner.jpg”); Setting Single Attribute (with function) $(“div”).attr(“id”, function (arr) { return “div-id” + arr; }) Setting Multiple Attributes $(“img”).attr({ src: “/images/banner.jpg”, title: “banner”, alt: “banner” }); Getting Attribute var $source...
Dump out all custom fields as a list <?php the_meta(); ?> Display value of one specific custom field <?php echo get_post_meta($post->ID, ‘mood’, true); ?> “mood” would be ID value of custom field Display multiple...
Placeholder text in inputs has (in the browsers implementing it so far) a light gray color. To style it, you’ll need vendor prefix CSS properties. ::-webkit-input-placeholder { color: red; } :-moz-placeholder { /* Firefox...
WebKit desktop browsers add little up down arrows to number inputs called spinners. You can turn them off visually like this: input[type=number]::-webkit-inner-spin-button, input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
HTMl <div class=”inner-border”> Transparent Inside Border </div> CSS .inner-border { background: #000; color: #fff; margin: 50px; padding: 15px; position: relative; } .inner-border:before { border: 5px solid #000; content: “”; position: absolute; top: -10px; bottom:...
a { position: relative; padding-bottom: 6px; } a:hover::after{ content: “”; position: absolute; bottom: 2px; left: 0; height: 1px; width: 100%; background: #444; background: -webkit-gradient(linear, left top, right top, color-stop(0%,transparent), color-stop(50%,#444), color-stop(100%,transparent)); background: -webkit-linear-gradient(left, transparent...
This is WebKit only, but is the cleanest way to accomplish it as the text remains editable and selectable web text. h1 { font-size: 72px; background: -webkit-linear-gradient(#eee, #333); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
This is like a replacement for PHP’s SCRIPT_NAME with JavaScript. location.href.split(‘/’).pop(); For example with this URL: http://css-tricks.com/examples/ScriptName/index.php This code: document.write( location.href.split(‘/’).pop() ); Would write to the page: “index.php” Reference URL
JavaScript is supported by the Camino, Firefox, Google Chrome, iCab, Internet Explorer, Konqueror, Netscape, OmniWeb, Opera, Safari and SeaMonkey Web browsers, and so almost everyone can use it. However, some people worry that JavaScript...
<script type=”text/javascript”> document.write(“Welcome, you have Javascript on.”) </script> <noscript>JavaScript is off. Please enable to view full site.</noscript>
This will find what the ID is of the top-most parent Page, in a nested child page. For example, this page you are literally looking at is nested under <?php if ($post->post_parent) { $ancestors=get_post_ancestors($post->ID);...
The post mockup was this: I coded up one way to do it which works, but isn’t quite perfect. I figured I’d post it here and you all could chime in with better ways...
$html = file_get_contents(‘http://www.example.com’); $dom = new DOMDocument(); @$dom->loadHTML($html); // grab all the on the page $xpath = new DOMXPath($dom); $hrefs = $xpath->evaluate(“/html/body//a”); for ($i = 0; $i < $hrefs->length; $i++) { $href = $hrefs->item($i);...
PHP CODE: function getMSIE6() { $userAgent = strtolower($_SERVER[“HTTP_USER_AGENT”]); if (ereg(“msie 6”, $userAgent) || ereg(“msie 5”, $userAgent)) { return true; } return false; }
It doesn’t have all the fancy callbacks and options, but hey, it makes things draggable (and with a specified handle optionally). (function($) { $.fn.drags = function(opt) { opt = $.extend({handle:””,cursor:”move”}, opt); if(opt.handle === “”)...
The HTTP_X_REQUESTED_WITH header is sent by all recent browsers that support AJAX requests. if ( !empty($_SERVER[‘HTTP_X_REQUESTED_WITH’]) && strtolower($_SERVER[‘HTTP_X_REQUESTED_WITH’]) == ‘xmlhttprequest’ ) { # Ex. check the query and serve requested data
var news = 2; hidenews = “- Hide news archive”; shownews = “+ Show news archive”; $(“.archive”).html( shownews ); $(“.news:not(:lt(“+news+”))”).hide(); $(“.archive”).click(function (e) { e.preventDefault(); if ($(“.news:eq(“+news+”)”).is(“:hidden”)) { $(“.news:hidden”).show(); $(“.archive”).html( hidenews ); } else {...
It’s a quick read that that drives home a great point. Transitions and animations can be more than eye candy. They can help give your brain a clue about what is happening on a...
<link rel=”stylesheet” media=”all and (orientation:portrait)” href=”portrait.css”> <link rel=”stylesheet” media=”all and (orientation:landscape)” href=”landscape.css”>
See the two commented lines below, that is where you can insert code for things to do when the user goes idle, and when the user comes back. Set the idle period on the...