jntu_gnec/CSS Zoom ( CSS)
HTML :
<div>
<p id="one">☻</p>
<p id="two">☻</p>
<p id="three">☺</p>
</div>
CSS :
* {
/*transition*/
-webkit-transition: all 0.2s ease;
-moz-transition: all 0.2s ease;
-o-transition: all 0.2s ease;
transition: all 0.2s ease;
}
body {
overflow: hidden;
font-size: 50px;
font-family: "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif;
font-weight: 300;
background: #dedede;
background: -webkit-radial-gradient(center, circle farthest-corner, rgba(255,255,255,0) 50%, rgba(200,200,200,1)), -webkit-radial-gradient(center, circle, rgba(255,255,255,.35), rgba(255,255,255,0) 20%, rgba(255,255,255,0) 21%), -webkit-radial-gradient(center, circle, rgba(0,0,0,.2), rgba(0,0,0,0) 20%, rgba(0,0,0,0) 21%), -webkit-radial-gradient(center, circle farthest-corner, #f0f0f0, #c0c0c0);
background: -moz-radial-gradient(center, circle farthest-corner, rgba(255,255,255,0) 50%, rgba(200,200,200,1)), -webkit-radial-gradient(center, circle, rgba(255,255,255,.35), rgba(255,255,255,0) 20%, rgba(255,255,255,0) 21%), -webkit-radial-gradient(center, circle, rgba(0,0,0,.2), rgba(0,0,0,0) 20%, rgba(0,0,0,0) 21%), -webkit-radial-gradient(center, circle farthest-corner, #f0f0f0, #c0c0c0);
background: -ms-radial-gradient(center, circle farthest-corner, rgba(255,255,255,0) 50%, rgba(200,200,200,1)), -webkit-radial-gradient(center, circle, rgba(255,255,255,.35), rgba(255,255,255,0) 20%, rgba(255,255,255,0) 21%), -webkit-radial-gradient(center, circle, rgba(0,0,0,.2), rgba(0,0,0,0) 20%, rgba(0,0,0,0) 21%), -webkit-radial-gradient(center, circle farthest-corner, #f0f0f0, #c0c0c0);
background: -o-radial-gradient(center, circle farthest-corner, rgba(255,255,255,0) 50%, rgba(200,200,200,1)), -webkit-radial-gradient(center, circle, rgba(255,255,255,.35), rgba(255,255,255,0) 20%, rgba(255,255,255,0) 21%), -webkit-radial-gradient(center, circle, rgba(0,0,0,.2), rgba(0,0,0,0) 20%, rgba(0,0,0,0) 21%), -webkit-radial-gradient(center, circle farthest-corner, #f0f0f0, #c0c0c0);
background: radial-gradient(center, circle farthest-corner, rgba(255,255,255,0) 50%, rgba(200,200,200,1)), -webkit-radial-gradient(center, circle, rgba(255,255,255,.35), rgba(255,255,255,0) 20%, rgba(255,255,255,0) 21%), -webkit-radial-gradient(center, circle, rgba(0,0,0,.2), rgba(0,0,0,0) 20%, rgba(0,0,0,0) 21%), -webkit-radial-gradient(center, circle farthest-corner, #f0f0f0, #c0c0c0);
background-size: 100% 100%, 10px 10px, 10px 10px, 100% 100%;
}
div {
width: 300px;
margin: 20px auto;
position: relative;
}
p {
border-radius:5px;
padding: 10px;
margin: 0;
display: block;
position: absolute;
text-align: center;
}
#one {
font-size: 50px;
top: 0;
left: 0;
}
#one:hover { font-size: 100px }
#two {
/*transform*/
-webkit-transform: scale(1);
-moz-transform: scale(1);
-ms-transform: scale(1);
-o-transform: scale(1);
transform: scale(1);
top: 0;
left: 100px;
}
#two:hover {
/*transform*/
-webkit-transform: scale(2);
-moz-transform: scale(2);
-ms-transform: scale(2);
-o-transform: scale(2);
transform: scale(2);
}
#three {
width: 50px;
height: 50px;
background: #000;
color: #fff;
text-align: center;
left: 200px;
top: 0;
}
#three:hover {
width: 100px;
height: 100px;
}
font-size: If you are using a character, then it is possible to zoom in and out by changing the font-size property on hover and combining it with the transition property for a smooth animation. transform: Another method is by using a scale transform in which you just have to specify how much you want the image to be zoomed in like 2x, 3x etc. It can be used for zoom out too by passing the values less than one. width and height: This is the most common and old techniqiue in which we change the dimensions of the element directly via css on hover or click with transitions. Take a look at the code to learn more about these techniques. If you know about more texhniques to create a zoom effect using CSS3, feel free to share it.
Antoine Pitrou/object finalization without __del__ and without hassles ( python)
import weakref
class Finalizable(object):
"""
Base class enabling the use a __finalize__ method without all the problems
associated with __del__ and reference cycles.
If you call enable_finalizer(), it will call __finalize__ with a single
"ghost instance" argument after the object has been deleted. Creation
of this "ghost instance" does not involve calling the __init__ method,
but merely copying the attributes whose names were given as arguments
to enable_finalizer().
A Finalizable can be part of any reference cycle, but you must be careful
that the attributes given to enable_finalizer() don't reference back to
self, otherwise self will be immortal.
"""
__wr_map = {}
__wr_id = None
def bind_finalizer(self, *attrs):
"""
Enable __finalize__ on the current instance.
The __finalize__ method will be called with a "ghost instance" as
single argument.
This ghost instance is constructed from the attributes whose names
are given to bind_finalizer(), *at the time bind_finalizer() is called*.
"""
cls = type(self)
ghost = object.__new__(cls)
ghost.__dict__.update((k, getattr(self, k)) for k in attrs)
cls_wr_map = cls.__wr_map
def _finalize(ref):
try:
ghost.__finalize__()
finally:
del cls_wr_map[id_ref]
ref = weakref.ref(self, _finalize)
id_ref = id(ref)
cls_wr_map[id_ref] = ref
self.__wr_id = id_ref
def remove_finalizer(self):
"""
Disable __finalize__, provided it has been enabled.
"""
if self.__wr_id:
cls = type(self)
cls_wr_map = cls.__wr_map
del cls_wr_map[self.__wr_id]
del self.__wr_id
class TransactionBase(Finalizable):
"""
A convenience base class to write transaction-like objects,
with automatic rollback() on object destruction if required.
"""
finished = False
def enable_auto_rollback(self):
self.bind_finalizer(*self.ghost_attributes)
def commit(self):
assert not self.finished
self.remove_finalizer()
self.do_commit()
self.finished = True
def rollback(self):
assert not self.finished
self.remove_finalizer()
self.do_rollback(auto=False)
self.finished = True
def __finalize__(ghost):
ghost.do_rollback(auto=True)
class TransactionExample(TransactionBase):
"""
A transaction example which close()s a resource on rollback
"""
ghost_attributes = ('resource', )
def __init__(self, resource):
self.resource = resource
self.enable_auto_rollback()
def __str__(self):
return "ghost-or-object %s" % object.__str__(self)
def do_commit(self):
pass
def do_rollback(self, auto):
if auto:
print "auto rollback", self
else:
print "manual rollback", self
self.resource.close()
The well-known way to avoid __del__ (and its problems when the object to be deleted is involved in a reference cycle) is to use a finalization callback on a weakref.
This recipe simply makes it easier to write such "finalizable" objects by allowing to write the finalizer as a __finalize__ method (a bit similar to a __del__ method, but not exactly as we'll see).
The first step is to call the bind_finalizer(*attrs) method on your instance; you must give bind_finalizer a list of attribute names necessary for the finalizer to operate, and it will construct a "ghost object" holding those attributes (for example, if you have a "socket" attribute you want to close, you will include "socket" in the arguments to bind_finalizer, which in turn will bind a "socket" attribute on the ghost object). The ghost object has the same class as the original self, so you will be able to call instance methods and use class variables in the finalizer as well.
Please note: the ghost object is created and its attributes are bound as soon as bind_finalizer() is called, so their values must have been properly initialized. A practical idiom is probably to call bind_finalizer() at the end of your constructor. Creating the ghost ignores any __new__ or __init__ method you have defined, so you don't have to worry about constructor signature or unwanted side effects.
Your __finalize__ method must be written as a normal method, except that it can only access those instance attributes whose names you gave to bind_finalizer. This is because __finalize__ gets a "ghost instance" instead of the original instance.
Finally, there is a remove_finalizer() which does the obvious. Call it when the resources have been somehow freed manually and automatic finalization is not useful anymore.
With this recipe, you have an object-oriented finalization scheme which still works as required when your instance is part of a reference cycle to be broken by the Garbage Collector. Also, it doesn't use metaclasses which makes it easier to re-use if you have your own metaclasses.
You can find hereafter the code for the Finalizeable class, as well as an example TransactionBase class which helps writing objects with transaction-like behaviour and optional automatic rollback on object destruction. (but the interesting stuff is really in Finalizable)
derebus/Ajax Calendar Extender - lanzar función al elegir una fecha ( VB.NET)
'So the TextBox code will look like this.
<asp:TextBox ID="txtDate" runat="server" OnTextChanged="txtDate_TextChanged" AutoPostBack="True"></asp:TextBox>
'and your code behind will look something like this (converted from C# but should be right)
Protected Sub txtDate_TextChanged(ByVal sender As Object, ByVal e As EventArgs)
'Do your stuff
End Sub
Util para lanzar un procedimiento o una función al elegir una fecha en un ajax calendar
ezerick/Fox XML in TSQL ( SQL)
The following example specifies FOR XML AUTO with the TYPE and XMLSCHEMA options. Because of the TYPE option, the result set is returned to the client as an xml type. The XMLSCHEMA option specifies that the inline XSD schema is included in the XML data returned, and the ELEMENTS option specifies that the XML result is element-centric. SQL USE AdventureWorks2008R2; GO SELECT p.BusinessEntityID, FirstName, LastName, PhoneNumber AS Phone FROM Person.Person AS p Join Person.PersonPhone AS pph ON p.BusinessEntityID = pph.BusinessEntityID WHERE LastName LIKE 'G%' ORDER BY LastName, FirstName FOR XML AUTO, TYPE, XMLSCHEMA, ELEMENTS XSINIL;
jntu_gnec/Favicon link in css ( CSS)
HTML :
<nav>
<a href="http://github.com">GitHub</a>
<a href="http://facebook.com">Facebook</a>
<a href="http://youtube.com">Youtube</a>
<a href="http://twitter.com">Twitter</a>
<a href="http://megawrz.com">megawrz</a>
</nav>
CSS:
body {background-image: ;
background-color: #999;
background-image: -webkit-linear-gradient(0, rgba(255,255,255,.07) 50%, transparent 50%), -webkit-linear-gradient(0, rgba(255,255,255,.13) 50%, transparent 50%), -webkit-linear-gradient(0, transparent 50%, rgba(255,255,255,.17) 50%), -webkit-linear-gradient(0, transparent 50%, rgba(255,255,255,.19) 50%);
background-image: -o-linear-gradient(0, rgba(255,255,255,.07) 50%, transparent 50%), -o-linear-gradient(0, rgba(255,255,255,.13) 50%, transparent 50%), -o-linear-gradient(0, transparent 50%, rgba(255,255,255,.17) 50%), -o-linear-gradient(0, transparent 50%, rgba(255,255,255,.19) 50%);
background-image: -moz-linear-gradient(0, rgba(255,255,255,.07) 50%, transparent 50%), -moz-linear-gradient(0, rgba(255,255,255,.13) 50%, transparent 50%), -moz-linear-gradient(0, transparent 50%, rgba(255,255,255,.17) 50%), -moz-linear-gradient(0, transparent 50%, rgba(255,255,255,.19) 50%);
background-image: -ms-linear-gradient(0, rgba(255,255,255,.07) 50%, transparent 50%), -ms-linear-gradient(0, rgba(255,255,255,.13) 50%, transparent 50%), -ms-linear-gradient(0, transparent 50%, rgba(255,255,255,.17) 50%), -ms-linear-gradient(0, transparent 50%, rgba(255,255,255,.19) 50%);
/*background-size*/
-webkit-background-size: 13px, 29px, 37px, 53px;
-moz-background-size: 13px, 29px, 37px, 53px;
-o-background-size: 13px, 29px, 37px, 53px;
background-size: 13px, 29px, 37px, 53px;
padding-top: 50px;
text-align: center;
}
nav {
height: 30px;
margin: 30px auto;
padding: 10px 5px;
/*border-radius*/
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
width: 560px;
bottom: 26px;
padding: 12px 12px 12px 12px;
background: #fff;
background: -webkit-gradient( linear,0 0,0 100%,from(#fff),to(#e5eaee) );
/*linear-gradient*/
background: -webkit-gradient(linear,,from(#fff),to(#e5eaee));
background: -webkit-linear-gradient( top center,#fff,#e5eaee );
background: -moz-linear-gradient( top center,#fff,#e5eaee );
background: -o-linear-gradient( top center,#fff,#e5eaee );
background: linear-gradient( top center,#fff,#e5eaee );
/*box-shadow*/
-webkit-box-shadow: 0 1px 2px #000;
-moz-box-shadow: 0 1px 2px #bdc9d5;
box-shadow: 0px 1px 5px #666;
font: 13px "helvetica",sans-serif;
font-weight: 300;
text-align: center;
text-shadow: 0 1px 0 #fff;
-webkit-tansition: all 10s linear infinite;
}
a[href*="github.com"] {
padding-left: 18px;
background: url(http://www.google.com/s2/u/0/favicons?domain=gist.github.com) left center no-repeat;
}
a[href*="facebook.com"] {
padding-left: 18px;
background: url(http://www.google.com/s2/u/0/favicons?domain=facebook.com) left center no-repeat;
}
a[href*="youtube.com"] {
padding-left: 18px;
background: url(http://www.google.com/s2/u/0/favicons?domain=youtube.com) left center no-repeat;
}
a[href*="twitter.com"] {
padding-left: 18px;
background: url(http://www.google.com/s2/u/0/favicons?domain=twitter.com) left center no-repeat;
}
a[href*="megawrz.com"] {
padding-left: 18px;
background: url(http://www.google.com/s2/u/0/favicons?domain=megawrz.com) left center no-repeat;
}
a {
/*transition*/
-webkit-transition: all 0.2s ease;
-moz-transition: all 0.2s ease;
-o-transition: all 0.2s ease;
transition: all 0.2s ease;
color: #999;
font-size: 12px;
text-decoration: none;
margin: 20px 20px;
padding-left: 23px !important;
text-shadow: 1px 1px 0px white;
}
a:hover { color: #555 }
show favicon with css
rubinsta/My Debian Aliases ( Bash)
# Alias definitions.
# You may want to put all your additions into a separate file like
# ~/.bash_aliases, instead of adding them here directly.
# See /usr/share/doc/bash-doc/examples in the bash-doc package.
#if [ -f ~/.bash_aliases ]; then
# . ~/.bash_aliases
#fi
# enable color support of ls and also add handy aliases
if [ "$TERM" != "dumb" ]; then
eval "`dircolors -b`"
alias ls='ls --color=auto'
#alias dir='ls --color=auto --format=vertical'
#alias vdir='ls --color=auto --format=long'
fi
# some more ls aliases
alias ll='ls -l'
alias la='ls -A'
alias l='ls -CF'
alias sud='sudo apt-get update'
alias sug='sudo apt-get upgrade'
alias last='last | less'
alias rq='sudo repquota -s /home'
# enable programmable completion features (you don't need to enable
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
# sources /etc/bash.bashrc).
if [ -f /etc/bash_completion ]; then
. /etc/bash_completion
fi
adrianparr/AS3 Loading and Using an External CSS File ( ActionScript 3)
package {
import flash.display.Sprite;
import flash.events.Event;
import flash.net.URLLoader;
import flash.net.URLRequest;
import flash.text.StyleSheet;
import flash.text.TextField;
import flash.text.TextFieldAutoSize;
public class CSSFormattingExample extends Sprite {
var loader:URLLoader;
var field:TextField;
var exampleText:String = "<h1>This is a headline</h1>" +
"<p>This is a line of text. <span class='bluetext'>" +
"This line of text is colored blue.</span></p>";
public function CSSFormattingExample():void {
field = new TextField();
field.width=300;
field.autoSize=TextFieldAutoSize.LEFT;
field.wordWrap=true;
addChild(field);
var req:URLRequest=new URLRequest("example.css");
loader = new URLLoader();
loader.addEventListener(Event.COMPLETE, onCSSFileLoaded);
loader.load(req);
}
public function onCSSFileLoaded(event:Event):void {
var sheet:StyleSheet = new StyleSheet();
sheet.parseCSS(loader.data);
field.styleSheet=sheet;
field.htmlText=exampleText;
}
}
}
// THE 'example.css' FILE SHOULD LOOK LIKE THIS ...
//p {
// font-family: Times New Roman, Times, _serif;
// font-size: 14;
//}
//
//h1 {
// font-family: Arial, Helvetica, _sans;
// font-size: 20;
// font-weight: bold;
//}
//
//.bluetext {
// color: #0000CC;
//}
iende/Related Posts problem ( PHP)
<?php get_header(); ?>
<div id="content">
<div id="contentleft">
<div class="postarea">
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<div class="posttitle">
<h3><?php the_title(); ?></h3>
<div class="postauthor">
<p><?php _e("Posted by", 'organicthemes'); ?> <?php the_author_posts_link(); ?> on <?php the_time('l, F j, Y'); ?> &middot; <a href="<?php the_permalink(); ?>#comments"><?php comments_number('Leave a Comment', '1 Comment', '% Comments'); ?></a>&nbsp;<?php edit_post_link('(Edit)', '', ''); ?></p>
</div>
</div>
<?php the_content(__('Read More'));?><div style="clear:both;"></div>
<?php trackback_rdf(); ?>
<div style="margin-top:10px"><script src="http://connect.facebook.net/fr_FR/all.js#xfbml=1"></script><fb:like show_faces="false" width="520" style="margin-right:10px"></fb:like><a href="http://twitter.com/share" class="twitter-share-button" data-count="horizontal" data-via="DetenteGenerale">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div>
<div class="postmeta">
<p><?php _e("Filed under", 'organicthemes'); ?> <?php the_category(', ') ?> &middot; <?php _e("Tagged with", 'organicthemes'); ?> <?php the_tags('') ?></p>
</div>
</div>
<div class="rel_box">
<?php
$tags = wp_get_post_tags($post->ID);
if ($tags) {
$first_tag = $tags[0]->term_id;
$args=array(
'tag__in' => array($first_tag),
'post__not_in' => array($post->ID),
'showposts'=>4,
'caller_get_posts'=>1
);
$rel_posts = new WP_Query($args);
if( $rel_posts->have_posts() ) {
while ($rel_posts->have_posts()) : $rel_posts->the_post(); ?>
<div class="rel_posts">
<div class="rel_thumb"><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_post_thumbnail(array(145,145)); ?></a></div>
<div class="rel_link"><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></a></div>
</div>
<?php
endwhile;
}
}
?>
<div class="clearer"></div>
</div>
<div class="postcomments">
<?php comments_template('',true); ?>
</div>
<?php endwhile; else: ?>
<p><?php _e("Sorry, no posts matched your criteria.", 'organicthemes'); ?></p>
<?php endif; ?>
</div>
<?php include(TEMPLATEPATH."/sidebar_right.php");?>
</div>
<!-- The main column ends -->
<?php get_footer(); ?>
Comments are not working properly after adding the rel_box div. The comments displayed are the ones from the last related post.
Can't figure out why. Check above link to see it on the website.
voodoochilo/MemcacheX ( PHP)
<?php
/*----------------------------------------------------------------------------
I've found no way to iterate over the keys stored in memcache.
Therefore I wrote this piece on a boring rainy sunday afternoon.
Have fun.
MemcacheX - A Memcache Class With Iteratable Keys
Version 0.0.01a
(C)2010 by Emil Endgut
==============================================================
This is Friendware, which means that you may use it as if you
wrote it, after you became a friend of mine on Facebook.
Please Visit:
http://www.facebook.com/profile.php?id=100001062124472
==============================================================
Usage Example:
<?php
require_once 'memcachex.php';
// Fire it up
$mx = new MemcacheX();
$mx->connect();
// Add some stuff
$mx->add("Key.1", "this is value 1");
$mx->add("Key.2", "this is value 2");
$mx->add("Tel.1", "112-358-1321");
$mx->add("Tel.2", "123-185-3211");
// Fetch the Keys
$mx_keys = $mx->keys();
// Work on 'em
foreach($mx_keys as $key)
{
if(substr($key, 0, 3) == "key"){
echo "KEY: " . $key . "\n";
}
if(substr($key, 0, 3) == "tel"){
echo "TEL: " . $key . "\n";
}
}
?>
----------------------------------------------------------------------------*/
// some consts
define("MEMCACHEX_HOST", "localhost");
define("MEMCACHEX_PORT", "11211");
define("MEMCACHEX_KEY", "MEMCACHEX_KEY");
class MemcacheX extends Memcache
{
var $indexdata; // the key index
// Overloaded Memcache Methods ===========================================
//------------------------------------------------------------------------
// Constructor
// (note: memcache doesn't like it to be constructed as parent,
// therefore omitted.)
//------------------------------------------------------------------------
function __construct()
{
// Index init
$this->indexdata[MEMCACHEX_KEY] = MEMCACHEX_KEY;
}
//------------------------------------------------------------------------
// store a (k,v) if k does not exist yet. otherwise false.
//------------------------------------------------------------------------
public function add($k, $v, $c=false, $d=0)
{
if($this->get($k) === false)
{
return $this->set($k, $v, $c, $d);
}
return false;
}
//------------------------------------------------------------------------
// connect to memcache-server. same as in baseclass except some init stuff
//------------------------------------------------------------------------
public function connect($host=MEMCACHEX_HOST, $port=MEMCACHEX_PORT, $timeout=1)
{
$con = parent::connect($host, $port, $timeout);
if($this->get(MEMCACHEX_KEY) == false)
{
parent::set(MEMCACHEX_KEY, serialize($this->indexdata), false, 0);
}
else
{
$this->indexdata = array();
$this->indexdata = unserialize(parent::get(MEMCACHEX_KEY));
}
return $con;
}
//------------------------------------------------------------------------
// delete k after d secs from memcache and index
//------------------------------------------------------------------------
public function delete($k, $d=0)
{
if($ret = parent::delete($k, $d))
{
$this->x_delkey($k);
return $ret;
}
return false;
}
//------------------------------------------------------------------------
// get v for k from memcache
//------------------------------------------------------------------------
public function get($k)
{
$value = parent::get($k);
if($value === false)
{
$this->x_delkey($k);
}
return $value;
}
//------------------------------------------------------------------------
// replace v of k in memcache
//------------------------------------------------------------------------
public function replace($k, $v, $c=false, $d=0)
{
return $this->set($k, $v, $c, $d);
}
//------------------------------------------------------------------------
// set v for k in memcache
//------------------------------------------------------------------------
public function set($k, $v, $c=false, $d=0)
{
if(parent::set($k, $v, $c, $d))
{
return $this->x_setkey($k, $d);
}
return false;
}
// New Key Index Methods =================================================
//------------------------------------------------------------------------
// get all keys stored in memcache as an array
//------------------------------------------------------------------------
public function keys()
{
$this->x_read();
return array_keys($this->indexdata);
}
// Protected Key Index Methods ===========================================
//------------------------------------------------------------------------
// set/insert/add some key in keyindex (d is currently not used)
//------------------------------------------------------------------------
protected function x_setkey($k, $d=0)
{
$this->x_read();
$this->indexdata[$k] = $d;
return $this->x_write();
}
//------------------------------------------------------------------------
// delete key from keyindex
//------------------------------------------------------------------------
protected function x_delkey($k)
{
$this->x_read();
unset($this->indexdata[$k]);
$this->x_write();
}
//------------------------------------------------------------------------
// read keyindex from memcache into array
//------------------------------------------------------------------------
protected function x_read()
{
$this->indexdata = unserialize(parent::get(MEMCACHEX_KEY));
return $this->indexdata;
}
//------------------------------------------------------------------------
// write array into keyindex & store index in memcache
//------------------------------------------------------------------------
protected function x_write()
{
return parent::set(MEMCACHEX_KEY, serialize($this->indexdata),false,0);
}
}
?>
victoriano/Source Code of Source Code ( HTML)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title></title>
<meta property="og:title" content="Source Code"/>
<meta property="og:type" content="movie"/>
<meta property="og:url" content="http://www.EnterTheSourceCode.com"/>
<meta property="og:image" content="http://www.enterthesourcecode.com/images/share/facebook.jpg"/>
<meta property="og:site_name" content="Source Code - In Theaters Now"/>
<meta property="og:description" content="Play &quot;THE SOURCE CODE MISSION&quot; for your chance to win a trip to the 2012 SXSW Film and Interactive Festival and other cool prizes. Source Code - in theaters now."/>
<meta name="title" content="Source Code Movie - In Theaters Now" />
<meta name="description" content="When decorated soldier Captain Colter Stevens (Jake Gyllenhaal) wakes up in the body of an unknown man, he discovers he's part of a mission to find the bomber of a Chicago commuter train. In an assignment unlike any he's ever known, he learns he's part of a government experiment called the Source Code, a program that enables him to cross over into another man's identity in the last 8 minutes of his life. With a second, much larger target threatening to kill millions in downtown Chicago, Colter re-lives the incident over and over again, gathering clues each time, until he can solve the mystery of who is behind the bombs and prevent the next attack. Filled with mind-boggling twists and heart-pounding suspense, Source Code is a smart action-thriller directed by Duncan Jones (Moon) also starring Michelle Monaghan (Eagle Eye, Due Date), Vera Farmiga (Up in the Air, The Departed), and Jeffrey Wright (Quantum of Solace, Syriana)." />
<meta name="keywords" content="SOURCE CODE, April 1, 2011, Action and Adventure, Thriller, Duncan Jones, Ben Ripley, Jake Gyllenhaal, Michelle Monaghan, Vera Farmiga, Jeffrey Wright" />
<meta property="fb:admins" content="686030693" />
<link rel="image_src" href="http://www.enterthesourcecode.com/images/share/facebook.jpg" />
<script src="http://connect.facebook.net/en_US/all.js"></script>
<script type="text/javascript" src="js/swfobject.js"></script>
<script type="text/javascript" src="js/swffit.js"></script>
<script type="text/javascript" src="js/resize.js"></script>
<script type="text/javascript" src="js/likeButton.js"></script>
<script type="text/javascript" src="js/mobileDetection.js"></script>
<script type="text/javascript" src="js/swfaddress.js"></script>
<script type="text/javascript" src="js/datecode.js"></script>
<!-- GOOGLE ANALYTICS -->
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-19806767-1']);
_gaq.push(['_setDomainName', '.enterthesourcecode.com']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
<link rel="stylesheet" type="text/css" href="css/styles.css" />
<link rel="image_src" href="http://www.enterthesourcecode.com/images/share/facebook.jpg" />
<link rel="SHORTCUT ICON" href="images/favicon.ico" />
</head>
<body>
<script type="text/javascript">
FB.init({status: true, cookie: true, xfbml: true});
FB.XFBML.parse();
</script>
<!-- Container -->
<div id="container">
<!-- Flash content -->
<div id="flashContent">
<script type="text/javascript">
var attributes = {};
var flashvars = {};
var params = {};
flashvars.as_swf_name = "flashContent";
attributes.id = "flashContent";
attributes.name = "flashContent";
attributes.allowscriptaccess = "always";
params.wmode = "transparent";
params.scale = "noscale";
params.bgcolor = "#000000";
params.allowfullscreen = true;
params.allowscriptaccess = "always";
swfobject.embedSWF("main.swf", "flashContent", "100%", "100%", "10.0.0", "js/expressInstall.swf", flashvars, params, attributes);
swffit.fit("flashContent", 1024, 768);
</script>
<div id="noflash">
<p><strong>You need to upgrade your Flash Player</strong></p>
<p><a href="index.html?detectflash=false">Click here</a> if you are sure you have the latest Flash Player.</p>
<ul>
<li style="display: inline;"><a href="http://www.enterthesourcecode.com">Source Code Movie</a> |</li>
<li style="display: inline;"><a href="http://www.enterthesourcecode.com/trailer.html">Source Code Trailer</a></li>
<li style="list-style: none">|</li>
<li style="display: inline;"><a href="http://www.enterthesourcecode.com/photogallery.html">Source Code Photo Gallery</a></li>
</ul>
<h1>Source Code Movie - The Official Site for the Source Code Film</h1>
<p>When decorated soldier Captain Colter Stevens (Jake Gyllenhaal) wakes up in the body of an unknown man, he discovers he's part of a mission to find the bomber of a Chicago commuter train. In an assignment unlike any he's ever known, he learns he's part of a government experiment called the Source Code, a program that enables him to cross over into another man's identity in the last 8 minutes of his life. With a second, much larger target threatening to kill millions in downtown Chicago, Colter re-lives the incident over and over again, gathering clues each time, until he can solve the mystery of who is behind the bombs and prevent the next attack. Filled with mind-boggling twists and heart-pounding suspense, Source Code is a smart action-thriller directed by Duncan Jones (Moon) also starring Michelle Monaghan (Eagle Eye, Due Date), Vera Farmiga (Up in the Air, The Departed), and Jeffrey Wright (Quantum of Solace, Syriana).</p>
<h2>Source Code Movie Plot &amp; Story</h2>
<p>Watch <a href="http://www.enterthesourcecode.com/trailer.html">Source Code trailers</a> for sneak peeks at the new <strong>Source Code movie</strong>. See
<a href="http://www.enterthesourcecode.com/trailer.html">Source Code previews</a> and scenes from the new Source Code film in theaters on April 1, 2011.</p>
<p>Browse through <a href="http://www.enterthesourcecode.com/photogallery.html">Source Code photos</a> and pictures featuring <strong>Jake Gyllenhaal</strong>
and <strong>Michelle Monaghan</strong> from the new <strong>Source Code movie</strong>. Don&#39;t forget to watch the <strong>Source Code movie</strong> coming
to theaters on April 1, 2011.</p>
<br>
<h2>View the Source Code Photo Gallery</h2>
<p>On April 1, 2011, <strong>Jake Gyllenhaal</strong> and <strong>Michelle Monaghan</strong> star in the thrilling action movie
<strong>Source Code</strong>.</p>
<p>View the <strong>Source Code photo gallery</strong> featuring <strong>Jake Gyllenhaal</strong> and <strong>Michelle Monaghan</strong> in scenes of the
<a href="http://www.enterthesourcecode.com">Source Code film</a>. See photos and pictures of scenes featuring <strong>Jake Gyllenhaal</strong> in the new
<a href="http://www.enterthesourcecode.com">Source Code movie</a>.</p>
<h2>Source Code Photos &amp; Pictures</h2>
<p>Browse the <strong>Source Code photo gallery</strong> featuring photos and pictures from the <a href="http://www.enterthesourcecode.com">Source Code movie</a>.
Get a sneak peek at <a href="http://www.enterthesourcecode.com">Source Code movie</a> scenes with videos and video clips featuring <strong>Jake Gyllenhaal</strong> and <strong>Michelle Monaghan</strong> in the <a href="http://www.enterthesourcecode.com/trailer.html">Source Code trailer</a>.</p>
<p>Catch <strong>Jake Gyllenhaal</strong> in the <a href="http://www.enterthesourcecode.com">Source Code movie</a> and see photos and pictures featuring
scenes from the new movie <strong>Source Code</strong>.</p>
<p>Enjoy the feature packed <a href="http://www.enterthesourcecode.com/trailer.html">Source Code trailer</a> starring <strong>Jake Gyllenhaal</strong> and
<strong>Michelle Monaghan</strong>.</p>
<p>Watch the <a href="http://www.enterthesourcecode.com">Source Code movie</a> in theaters on April 1, 2011. Check out photos from the movie
<strong>Source Code</strong> in the photo gallery and see <strong>Jake Gyllenhaal</strong> and <strong>Michelle Monaghan</strong> in scenes and clips from
the <a href="http://www.enterthesourcecode.com">Source Code film</a>.</p>
<br>
<h2>Watch Source Code Movie Trailers</h2>
<p>On April 1, 2011, <strong>Jake Gyllenhaal</strong> star in this thrilling action movie <strong>Source Code</strong> .</p>
<h2>Source Code Movie Previews - Source Code Videos &amp; Video Clips</h2>
<p>View the <strong>Source Code trailer</strong> featuring <strong>Jake Gyllenhaal</strong> and <strong>Michelle Monaghan</strong> in thrilling action
scenes of the <a href="http://www.enterthesourcecode.com">Source Code film</a>. See videos and video clips of action scenes featuring <strong>Jake Gyllenhaal</strong> and <strong>Michelle Monaghan</strong> in the new movie <strong>Source Code</strong>.</p>
<p>Watch <strong>Source Code previews</strong> featuring scenes from the <a href="http://www.enterthesourcecode.com">Source Code movie</a>. Get a sneak peek at
Source Code with video clips and videos featuring <strong>Jake Gyllenhaal</strong> and <strong>Michelle Monaghan</strong> in the <strong>Source Code
trailer</strong>.</p>
<p>Catch <strong>Jake Gyllenhaal</strong> and <strong>Michelle Monaghan</strong> in <strong>Source Code</strong> and watch previews and videos featuring
scenes from the new <a href="http://www.enterthesourcecode.com">Source Code movie</a>. Enjoy the feature packed trailer of the movie <a href=
"http://www.enterthesourcecode.com">Source Code movie</a> starring <strong>Jake Gyllenhaal</strong>.</p>
<p>Watch the <a href="http://www.enterthesourcecode.com">Source Code movie</a> in theaters on April 1, 2011. Check out photos from the <a href=
"http://www.enterthesourcecode.com/photogallery.html">Source Code photo gallery</a> and see <strong>Jake Gyllenhaal</strong> and <strong>Michelle Monaghan</strong> in scenes and clips from the <a href="http://www.enterthesourcecode.com">Source Code film</a>.</p>
<p>Don&#39;t miss the <a href="http://www.enterthesourcecode.com">Source Code movie</a> starring <strong>Jake Gyllenhaal</strong> and <strong>Michelle Monaghan</strong> including <a href="http://www.enterthesourcecode.com/photogallery.html">Source Code pictures</a> and <a href=
"http://www.enterthesourcecode.com/photogallery.html">Source Code photos</a>, and watch the <a href="http://www.enterthesourcecode.com">Source Code film</a> in theaters
on April 1, 2011.</p>
<p>Become a fan of the Source Code movie <a href="http://www.facebook.com/SourceCode">Source Code</a> on Facebook.</p>
</div>
<a href="http://www.adobe.com/go/getflashplayer">
<img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" />
</a>
</div>
<!-- Social share buttons -->
<div id="socialButtons">
<div id="likeButton">
<!--
1
-->
<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.facebook.com/SourceCode&amp;layout=button_count&amp;show_faces=true&amp;width=100&amp;action=like&amp;colorscheme=light&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:100px; height:21px;" allowTransparency="true"></iframe>
</div>
</div>
</div>
<!-- /Container -->
</body>
</html>
sdellow/Wordpress Code Snippets ( HTML)
<h2>Automatically Add Twitter and Facebook Buttons to Your Posts</h2><p>This snippet will add Twitter and Facebook buttons to the bottom of all your posts. All you have to do is paste the code below into your <code>functions.php</code> file:</p><pre class="brush: php; title: ;" title="">
function share_this($content){
if(!is_feed() &amp;&amp; !is_home()) {
$content .= '&lt;div class=&quot;share-this&quot;&gt;
&lt;a href=&quot;http://twitter.com/share&quot;
class=&quot;twitter-share-button&quot;
data-count=&quot;horizontal&quot;&gt;Tweet&lt;/a&gt;
&lt;script type=&quot;text/javascript&quot;
src=&quot;http://platform.twitter.com/widgets.js&quot;&gt;&lt;/script&gt;
&lt;div class=&quot;facebook-share-button&quot;&gt;
&lt;iframe
src=&quot;http://www.facebook.com/plugins/like.php?href='.
urlencode(get_permalink($post-&gt;ID))
.'&amp;amp;layout=button_count&amp;amp;show_faces=false&amp;amp;width=200&amp;amp;action=like&amp;amp;colorscheme=light&amp;amp;height=21&quot;
scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;border:none;
overflow:hidden; width:200px; height:21px;&quot;
allowTransparency=&quot;true&quot;&gt;&lt;/iframe&gt;
&lt;/div&gt;
&lt;/div&gt;';
}
return $content;
}
add_action('the_content', 'share_this');
</pre><p><a href="http://www.wprecipes.com/automatically-add-twitter-and-facebook-buttons-to-your-posts" class="button-med">Source &rarr;</a></p><h2>Track Post View Amount by Using Post Meta</h2><p>For a simple way to keep track of the number of post views, paste this snippet into the <code>functions.php</code>, and then follow steps 1 and 2.</p><pre class="brush: php; title: ;" title="">
function getPostViews($postID){
$count_key = 'post_views_count';
$count = get_post_meta($postID, $count_key, true);
if($count==''){
delete_post_meta($postID, $count_key);
add_post_meta($postID, $count_key, '0');
return &quot;0 View&quot;;
}
return $count.' Views';
}
function setPostViews($postID) {
$count_key = 'post_views_count';
$count = get_post_meta($postID, $count_key, true);
if($count==''){
$count = 0;
delete_post_meta($postID, $count_key);
add_post_meta($postID, $count_key, '0');
}else{
$count++;
update_post_meta($postID, $count_key, $count);
}
}
</pre><p>Step 1: Paste the code below within the <code>single.php</code> within the loop:</p><pre class="brush: php; title: ;" title="">
&lt;?php
setPostViews(get_the_ID());
?&gt;
</pre><p>Step 2: Paste the snippet below anywhere within the template where you would like to display the number of views:</p><pre class="brush: php; title: ;" title="">
&lt;?php
echo getPostViews(get_the_ID());
?&gt;
</pre><p><a href="http://wpsnipp.com/index.php/functions-php/track-post-views-without-a-plugin-using-post-meta/" class="button-med">Source &rarr;</a></p><h2>Track Post View Amount by Using Post Meta</h2><p>This snippet will create a list of your most popular posts based on page views. Please note that this will only work if you have already implemented the &#8216;Track Post View Amount by Using Post Meta&#8217; from above.<br /> Place this snippet just before the loop within the <code>index.php</code> template and WordPress will use the post views to order your posts from highest to lowest.</p><pre class="brush: php; title: ;" title="">
&lt;?
query_posts('meta_key=post_views_count&amp;orderby=post_views_count&amp;order=DESC');
?&gt;
</pre><p><a href="http://wpsnipp.com/index.php/loop/most-popular-posts-using-views-post-meta/" class="button-med">Source &rarr;</a></p><h2>Breadcrumbs Without a Plugin</h2><p>Breadcrumbs can be a useful navigation technique that offers link to the previous page the user navigated through to arrive at the current post/page. There are plugins you could use, but the code snippet below could be an easier solution.</p><p>Paste this code into your <code>functions.php</code> file.</p><pre class="brush: php; title: ;" title="">
function the_breadcrumb() {
echo '&lt;ul id=&quot;crumbs&quot;&gt;';
if (!is_home()) {
echo '&lt;li&gt;&lt;a href=&quot;';
echo get_option('home');
echo '&quot;&gt;';
echo 'Home';
echo &quot;&lt;/a&gt;&lt;/li&gt;&quot;;
if (is_category() || is_single()) {
echo '&lt;li&gt;';
the_category(' &lt;/li&gt;&lt;li&gt; ');
if (is_single()) {
echo &quot;&lt;/li&gt;&lt;li&gt;&quot;;
the_title();
echo '&lt;/li&gt;';
}
} elseif (is_page()) {
echo '&lt;li&gt;';
echo the_title();
echo '&lt;/li&gt;';
}
}
elseif (is_tag()) {single_tag_title();}
elseif (is_day()) {echo&quot;&lt;li&gt;Archive for &quot;; the_time('F jS, Y'); echo'&lt;/li&gt;';}
elseif (is_month()) {echo&quot;&lt;li&gt;Archive for &quot;; the_time('F, Y'); echo'&lt;/li&gt;';}
elseif (is_year()) {echo&quot;&lt;li&gt;Archive for &quot;; the_time('Y'); echo'&lt;/li&gt;';}
elseif (is_author()) {echo&quot;&lt;li&gt;Author Archive&quot;; echo'&lt;/li&gt;';}
elseif (isset($_GET['paged']) &amp;&amp; !empty($_GET['paged'])) {echo &quot;&lt;li&gt;Blog Archives&quot;; echo'&lt;/li&gt;';}
elseif (is_search()) {echo&quot;&lt;li&gt;Search Results&quot;; echo'&lt;/li&gt;';}
echo '&lt;/ul&gt;';
}</pre><p>Then paste the calling code below, wherever you would like the breadcrumbs to appear (typically above the title tag).</p><pre class="brush: php; title: ;" title="">&lt;?php the_breadcrumb(); ?&gt;</pre><p><a href="http://wp-snippets.com/breadcrumbs-without-plugin/" class="button-med">Source &rarr;</a></p><h2>Display the Number of Facebook Fans</h2><p>Facebook is a must site for sharing your blogs articles. Here is a method for showing your visitors the total number of Facebook &#8216;Likes&#8217; your blog currently has.</p><p>To use this code all you have to do is replace the <strong>YOUR PAGE-ID</strong> with your own Facebook page id.</p><pre class="brush: php; title: ;" title="">&lt;?php
$page_id = &quot;YOUR PAGE-ID&quot;;
$xml = @simplexml_load_file(&quot;http://api.facebook.com/restserver.php?method=facebook.fql.query&amp;query=SELECT%20fan_count%20FROM%20page%20WHERE%20page_id=&quot;.$page_id.&quot;&quot;) or die (&quot;a lot&quot;);
$fans = $xml-&gt;page-&gt;fan_count;
echo $fans;
?&gt;</pre><p><a href="http://wp-snippets.com/display-number-facebook-fans/" class="button-med">Source &rarr;</a></p><h2>Display an External RSS Feed</h2><p>This snippet will fetch the latest entries of any specified feed url.</p><pre class="brush: php; title: ;" title="">&lt;?php include_once(ABSPATH.WPINC.'/rss.php');
wp_rss('http://wpforums.com/external.php?type=RSS2', 5); ?&gt;</pre><p>This code takes the rss.php file that is built into WordPress (used for widgets). It is set to display the most recent 5 posts from the RSS feed &#8216;http://example.com/external.php?type=RSS2&#8242;.</p><p><a href="http://wphacks.com/how-to-adding-an-external-rss-feed-to-your-wordpress-blog/" class="button-med">Source &rarr;</a></p><h2>WP Shortcode to Display External Files</h2><p>If you are looking for a quick way to automatically include external page content within your post, this snippet will create a shortcode allowing you to do it.</p><p>Paste this code into your themes <code>functions.php</code> file:</p><pre class="brush: php; title: ;" title="">
function show_file_func( $atts ) {
extract( shortcode_atts( array(
'file' =&gt; ''
), $atts ) );
if ($file!='')
return @file_get_contents($file);
}
add_shortcode( 'show_file', 'show_file_func' );
</pre><p>And then post this shortcode, editing the URL, into your post or page.</p><pre class="brush: php; title: ;" title="">
[show_file file=&quot;http://speckyboy.com/2010/12/09/20-plugin-replacing-tutorials-tips-snippets-and-solutions-for-wordpress/&quot;]
</pre><p><a href="http://www.prelovac.com/vladimir/wordpress-shortcode-snippet-to-display-external-files" class="button-med">Source &rarr;</a></p><h2>Create Custom Widgets</h2><p><img src="http://speckyboy.com/wp-content/uploads/2011/03/wp_snippet_06.jpg" alt="Create Custom Widgets"><br /> Wordpress provides many widgets, but if you want to create custom widgets tailored to your blog, then this snippet may help you.</p><p>Paste the code below into your <code>functions.php</code> file.</p><pre class="brush: php; title: ;" title=""> class My_Widget extends WP_Widget {
function My_Widget() {
parent::WP_Widget(false, 'Our Test Widget');
}
function form($instance) {
// outputs the options form on admin
}
function update($new_instance, $old_instance) {
// processes widget options to be saved
return $new_instance;
}
function widget($args, $instance) {
// outputs the content of the widget
}
}
register_widget('My_Widget');
</pre><p><a href="http://www.darrenhoyt.com/2009/12/22/creating-custom-wordpress-widgets/" class="button-med">Source &rarr;</a></p><h2>Create Custom Shortcodes</h2><p>Shortcodes are a handy way of using code functions within your theme. The advantage of shortcodes is that they can be easily used with the WordPress post editor.</p><p>Add this code to your <code>functions.php</code>:</p><pre class="brush: php; title: ;" title="">function helloworld() {
return 'Hello World!';
}
add_shortcode('hello', 'helloworld');</pre><p>You can then use [hello] wherever you want to display the content of the shortcode.</p><p><a href="http://wp-snippets.com/add-shortcodes/" class="button-med">Source &rarr;</a></p><h2>Custom Title Length</h2><p>This snippet will allow you to customise the length (by the number of characters) of your post title.</p><p>Paste this code into the <code>functions.php</code>:</p><pre class="brush: php; title: ;" title="">
function ODD_title($char)
{
$title = get_the_title($post-&gt;ID);
$title = substr($title,0,$char);
echo $title;
}</pre><p>To use this function all you have to do is paste the below code into your theme files, remembering to change the &#8217;20&#8242; to what ever character amount you require:</p><pre class="brush: php; title: ;" title="">
&lt;?php ODD_title(20); ?&gt;
</pre><p><a href="http://www.orangedevdesign.nl/nieuws/wordpress-title-custom-length/" class="button-med">Source &rarr;</a></p><h2>Custom Excerpts</h2><p>Sometimes you may need to limit how many words are in the excerpt, with this snippet you can create your own custom excerpt (my_excerpts) replacing the original.</p><p>Paste this code in <code>functions.php</code>.</p><pre class="brush: php; title: ;" title="">
&lt;?php add_filter('the_excerpt', 'my_excerpts');
function my_excerpts($content = false) {
global $post;
$mycontent = $post-&gt;post_excerpt;
$mycontent = $post-&gt;post_content;
$mycontent = strip_shortcodes($mycontent);
$mycontent = str_replace(']]&gt;', ']]&amp;gt;', $mycontent);
$mycontent = strip_tags($mycontent);
$excerpt_length = 55;
$words = explode(' ', $mycontent, $excerpt_length + 1);
if(count($words) &gt; $excerpt_length) :
array_pop($words);
array_push($words, '...');
$mycontent = implode(' ', $words);
endif;
$mycontent = '&lt;p&gt;' . $mycontent . '&lt;/p&gt;';
// Make sure to return the content
return $mycontent;
}
?&gt;</pre><p>Secondly, paste this code within the Loop:</p><pre class="brush: php; title: ;" title="">
&lt;?php echo my_excerpts(); ?&gt;
</pre><p><a href="http://wptricks.net/create-you-own-excerpt-in-wordpress/" class="button-med">Source &rarr;</a></p><h2>Redirect Your Post Titles To External Links</h2><p><img src="http://speckyboy.specky.netdna-cdn.com/wp-content/uploads/2011/03/wp_snippet_01.jpg" alt="Redirect Your Post Titles To External Links"><br /> This snippet could be useful for anyone with a news submission site, by redirecting your post title to an external URL when clicked via a custom field.</p><p>Paste this snippet into your <code>functions.php</code> file:</p><pre class="brush: php; title: ;" title="">//Custom Redirection
function print_post_title() {
global $post;
$thePostID = $post-&gt;ID;
$post_id = get_post($thePostID);
$title = $post_id-&gt;post_title;
$perm = get_permalink($post_id);
$post_keys = array(); $post_val = array();
$post_keys = get_post_custom_keys($thePostID);
if (!empty($post_keys)) {
foreach ($post_keys as $pkey) {
if ($pkey=='url') {
$post_val = get_post_custom_values($pkey);
}
}
if (empty($post_val)) {
$link = $perm;
} else {
$link = $post_val[0];
}
} else {
$link = $perm;
}
echo '&lt;h2&gt;&lt;a href=&quot;'.$link.'&quot; rel=&quot;bookmark&quot; title=&quot;'.$title.'&quot;&gt;'.$title.'&lt;/a&gt;&lt;/h2&gt;';
}</pre><p>Then you add a custom field named &#8216;url&#8217; and in the value field put the link to which the title is to be redirected to.</p><p><a href="http://www.wprecipes.com/how-to-link-to-some-external-ressource-in-post-title" class="button-med">Source &rarr;</a></p><h2>Redirect to Single Post If There is One Post in Category/Tag</h2><p>If there is only one post within a category or tag, this little snippet will jump the reader directly to the post page.</p><p>Paste this code into your themes <code>functions.php</code> file:</p><pre class="brush: php; title: ;" title="">
function stf_redirect_to_post(){
global $wp_query;
// If there is one post on archive page
if( is_archive() &amp;&amp; $wp_query-&gt;post_count == 1 ){
// Setup post data
the_post();
// Get permalink
$post_url = get_permalink();
// Redirect to post page
wp_redirect( $post_url );
}
} add_action('template_redirect', 'stf_redirect_to_post');
</pre><p><a href="http://shailan.com/how-to-redirect-to-single-post-page-if-there-is-one-post-in-categorytag/" class="button-med">Source &rarr;</a></p><h2>List Scheduled/Future Posts</h2><p>Paste the code anywhere on your template where you want your scheduled posts to be listed, changing the max number or displayed posts by changing the value of showposts in the query.</p><pre class="brush: php; title: ;" title="">
&lt;?php
$my_query = new WP_Query('post_status=future&amp;order=DESC&amp;showposts=5');
if ($my_query-&gt;have_posts()) {
while ($my_query-&gt;have_posts()) : $my_query-&gt;the_post();
$do_not_duplicate = $post-&gt;ID; ?&gt;
&lt;li&gt;&lt;?php the_title(); ?&gt;&lt;/li&gt;
&lt;?php endwhile;
}
?&gt;
</pre><p><a href="http://www.wprecipes.com/how-to-list-scheduled-posts" class="button-med">Source &rarr;</a></p><h2>Screenshots of External Pages Without a Plugin</h2><p>This is a very simple URL script that will generate a screenshot of any website. Here is the URL:</p><pre class="brush: xml; title: ;" title="">http://s.wordpress.com/mshots/v1/http%3A%2F%2Fspeckyboy.com%2F?w=500</pre><p>To see what the link above does, <a href="http://s.wordpress.com/mshots/v1/http%3A%2F%2Fspeckyboy.com%2F?w=500" target="_blank">click here</a>.</p><p>All you have to do is insert your required URL in the place of the &#8216;speckyboy.com&#8217; part of the link and resize (&#8216;w=500&#8242;) as required.</p><h2>Add Content to the End of Each RSS Post</h2><p>Adding some extra content that is only viewable by your RSS subscribers couldn&#8217;t be easier with this snippet.<br /> Paste this code into the functions.php:</p><pre class="brush: php; title: ;" title="">
function feedFilter($query) {
if ($query-&gt;is_feed) {
add_filter('the_content','feedContentFilter');
}
return $query;
}
add_filter('pre_get_posts','feedFilter');
function feedContentFilter($content) {
$content .= '&lt;p&gt;Extra RSS content goes here... &lt;/p&gt;';
return $content;
}
</pre><p><a href="http://wptricks.net/how-to-add-content-to-the-end-of-each-rss-post/" class="button-med">Source &rarr;</a></p><h2>Reset Your WordPress Password</h2><p><img src="http://speckyboy.specky.netdna-cdn.com/wp-content/uploads/2011/03/wp_snippet_02.jpg" alt="Redirect Your Post Titles To External Links"></p><p>What would you do if you forget your WordPress Admin Password and you no longer have access to the admin area? To fix this all you have to do is jump to your PhpMyAdmin Sql-window and run the following command.</p><pre class="brush: sql; title: ;" title="">UPDATE `wp_users` SET `user_pass` = MD5('NEW_PASSWORD') WHERE `wp_users`.`user_login` =`YOUR_USER_NAME` LIMIT 1;</pre><p><a href="http://wp-snippets.com/reset-your-password/" class="button-med">Source &rarr;</a></p><h2>Detect Which Browser Your Visitors are Using</h2><p>If you want to use different stylesheets for different browsers, then this is a snippet you could use. It detects the browser your visitors are using and creates a different class for each browser. You can use that class to create custom stylesheets.</p><pre class="brush: php; title: ;" title="">add_filter('body_class','browser_body_class');
function browser_body_class($classes) {
global $is_lynx, $is_gecko, $is_IE, $is_opera, $is_NS4, $is_safari, $is_chrome, $is_iphone;
if($is_lynx) $classes[] = 'lynx';
elseif($is_gecko) $classes[] = 'gecko';
elseif($is_opera) $classes[] = 'opera';
elseif($is_NS4) $classes[] = 'ns4';
elseif($is_safari) $classes[] = 'safari';
elseif($is_chrome) $classes[] = 'chrome';
elseif($is_IE) $classes[] = 'ie';
else $classes[] = 'unknown';
if($is_iphone) $classes[] = 'iphone';
return $classes;
}</pre><p><a href="http://www.nathanrice.net/blog/browser-detection-and-the-body_class-function/" class="button-med">Source &rarr;</a></p><h2>Display Search Terms from Google Users</h2><p>If a visitor reached your site through Google&#8217;s search, this script will display the terms they searched for in order to find your site. Just paste it anywhere outside of the header section.</p><pre class="brush: php; title: ;" title="">
&lt;?php
$refer = $_SERVER[&quot;HTTP_REFERER&quot;];
if (strpos($refer, &quot;google&quot;)) {
$refer_string = parse_url($refer, PHP_URL_QUERY);
parse_str($refer_string, $vars);
$search_terms = $vars['q'];
echo 'Welcome Google visitor! You searched for the following terms to get here: ';
echo $search_terms;
};
?&gt;
</pre><p><a href="http://wp-snippets.com/display-search-terms-from-google-users/" class="button-med">Source &rarr;</a></p><h2>Show Different Content for Mac &amp; Windows</h2><p>If you ever have the need to display different content to either Mac or Windows users (ie. software download link for different platforms), you can paste the following code into your themes <code>functions.php</code> file. You can easily change the content of the function to your own needs.</p><pre class="brush: php; title: ;" title="">&lt;?php
if (stristr($_SERVER['HTTP_USER_AGENT'],&quot;mac&quot;)) {
echo ‘Hello, I\’m a Mac.’;
} else {
echo ‘And I\’m a PC.’;
}
?&gt;</pre>
Snippets for Wordpress functions
darkbaron1912/loading ( ActionScript 3)
var addedDefinitions : LoaderContext = new LoaderContext();
addedDefinitions.applicationDomain = ApplicationDomain.currentDomain;
var urlReq : URLRequest = new URLRequest(libary_swf);
var loader : Loader= new Loader();
loader.load(urlReq, addedDefinitions);
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadedGraphic);
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, loadUncomplete);
private function loadUncomplete(e:IOErrorEvent):void
{
sendNotification(GameFacade.ERRORGAME, "Error " +e.toString);
}
private function loadedGraphic(e:Event):void
{
sendNotification(GameFacade.LOADGRAPHIC) ;
gameInit();
}
/// loading css
package {
import flash.display.Sprite;
import flash.events.Event;
import flash.net.URLLoader;
import flash.net.URLRequest;
import flash.text.StyleSheet;
import flash.text.TextField;
import flash.text.TextFieldAutoSize;
public class CSSFormattingExample extends Sprite {
var loader:URLLoader;
var field:TextField;
var exampleText:String = "<h1>This is a headline</h1>" +
"<p>This is a line of text. <span class='bluetext'>" +
"This line of text is colored blue.</span></p>";
public function CSSFormattingExample():void {
field = new TextField();
field.width=300;
field.autoSize=TextFieldAutoSize.LEFT;
field.wordWrap=true;
addChild(field);
var req:URLRequest=new URLRequest("example.css");
loader = new URLLoader();
loader.addEventListener(Event.COMPLETE, onCSSFileLoaded);
loader.load(req);
}
public function onCSSFileLoaded(event:Event):void {
var sheet:StyleSheet = new StyleSheet();
sheet.parseCSS(loader.data);
field.styleSheet=sheet;
field.htmlText=exampleText;
}
}
}
// THE 'example.css' FILE SHOULD LOOK LIKE THIS ...
//p {
// font-family: Times New Roman, Times, _serif;
// font-size: 14;
//}
//
//h1 {
// font-family: Arial, Helvetica, _sans;
// font-size: 20;
// font-weight: bold;
//}
//
//.bluetext {
// color: #0000CC;
//}
publicbroadcast/Tween Max quicky ( ActionScript 3)
TweenMax.to(event.target.txt, .4, {tint:0xFF0000, ease:Expo.EaseInOut, onComplete:myFunctionNam});
ARGUMENTS:
1) $target : Object - Target MovieClip (or any other object) whose properties we're tweening
2) $duration : Number - Duration (in seconds) of the effect
3) $vars : Object - An object containing the end values of all the properties you'd like to have tweened (or if you're using the
TweenLite.from() method, these variables would define the BEGINNING values). For example:
alpha: The alpha (opacity level) that the target object should finish at (or begin at if you're
using TweenLite.from()). For example, if the target.alpha is 1 when this script is
called, and you specify this argument to be 0.5, it'll transition from 1 to 0.5.
x: To change a MovieClip's x position, just set this to the value you'd like the MovieClip to
end up at (or begin at if you're using TweenLite.from()).
SPECIAL PROPERTIES (**OPTIONAL**):
delay : Number - Amount of delay before the tween should begin (in seconds).
ease : Function - You can specify a function to use for the easing with this variable. For example,
gs.easing.Elastic.easeOut. The Default is Regular.easeOut.
easeParams : Array - An array of extra parameters to feed the easing equation. This can be useful when you
use an equation like Elastic and want to control extra parameters like the amplitude and period.
Most easing equations, however, don't require extra parameters so you won't need to pass in any easeParams.
autoAlpha : Number - Use it instead of the alpha property to gain the additional feature of toggling
the visible property to false when alpha reaches 0. It will also toggle visible
to true before the tween starts if the value of autoAlpha is greater than zero.
visible : Boolean - To set a DisplayObject's "visible" property at the end of the tween, use this special property.
volume : Number - Tweens the volume of an object with a soundTransform property (MovieClip/SoundChannel/NetStream, etc.)
tint : Number - To change a DisplayObject's tint/color, set this to the hex value of the tint you'd like
to end up at(or begin at if you're using TweenLite.from()). An example hex value would be 0xFF0000.
removeTint : Boolean - If you'd like to remove the tint that's applied to a DisplayObject, pass true for this special property.
frame : Number - Use this to tween a MovieClip to a particular frame.
onStart : Function - If you'd like to call a function as soon as the tween begins, pass in a reference to it here.
This is useful for when there's a delay.
onStartParams : Array - An array of parameters to pass the onStart function. (this is optional)
onUpdate : Function - If you'd like to call a function every time the property values are updated (on every frame during
the time the tween is active), pass a reference to it here.
onUpdateParams : Array - An array of parameters to pass the onUpdate function (this is optional)
onComplete : Function - If you'd like to call a function when the tween has finished, use this.
onCompleteParams : Array - An array of parameters to pass the onComplete function (this is optional)
persist : Boolean - if true, the TweenLite instance will NOT automatically be removed by the garbage collector when it is complete.
However, it is still eligible to be overwritten by new tweens even if persist is true. By default, it is false.
renderOnStart : Boolean - If you're using TweenFilterLite.from() with a delay and want to prevent the tween from rendering until it
actually begins, set this to true. By default, it's false which causes TweenLite.from() to render
its values immediately, even before the delay has expired.
overwrite : int - Controls how other tweens of the same object are handled when this tween is created. Here are the options:
- 0 (NONE): No tweens are overwritten. This is the fastest mode, but you need to be careful not to create any
tweens with overlapping properties, otherwise they'll conflict with each other.
- 1 (ALL): (this is the default unless OverwriteManager.init() has been called) All tweens of the same object
are completely overwritten immediately when the tween is created.
TweenLite.to(mc, 1, {x:100, y:200});
TweenLite.to(mc, 1, {x:300, delay:2, overwrite:1}); //immediately overwrites the previous tween
- 2 (AUTO): (used by default if OverwriteManager.init() has been called) Searches for and overwrites only
individual overlapping properties in tweens that are active when the tween begins.
TweenLite.to(mc, 1, {x:100, y:200});
TweenLite.to(mc, 1, {x:300, overwrite:2}); //only overwrites the "x" property in the previous tween
- 3 (CONCURRENT): Overwrites all tweens of the same object that are active when the tween begins.
TweenLite.to(mc, 1, {x:100, y:200});
TweenLite.to(mc, 1, {x:300, delay:2, overwrite:3}); //does NOT overwrite the previous tween because the first tween will have finished by the time this one begins.
FrederickWeiss/SIDEBAR ( PHP)
<?php
/**
* The Sidebar containing the primary and secondary widget areas.
*
* @package WordPress
* @subpackage Twenty_Ten
* @since Twenty Ten 1.0
*/
?>
<!-- SIDEBARAREA -->
<div id="sidebararea">
<!-- FACBOOK -->
<div id="sidebar_facebook">
<?/*
<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.facebook.com%2F%23%21%2Fpages%2FSarasota-FL%2FBalance-Health-Fitness%2F98328182813&amp;layout=standard&amp;show_faces=true&amp;width=280&amp;action=like&amp;font=verdana&amp;colorscheme=light&amp;height=80" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:280px; height:80px;" allowTransparency="true"></iframe>
*/?>
</div>
<!-- /FACBOOK -->
<? if (is_page()) { ?>
<!-- SUBMENU -->
<?php
$has_subpages = false;
// Check to see if the current page has any subpages
$children = wp_list_pages('&child_of='.$post->ID.'&echo=0');
if($children) {
$has_subpages = true;
}
// Reseting $children
$children = "";
// Fetching the right thing depending on if we're on a subpage or on a parent page (that has subpages)
if(is_page() && $post->post_parent) {
// This is a subpage
$children = wp_list_pages("sort_column=menu_order&title_li=&include=".$post->post_parent ."&echo=0");
$children .= wp_list_pages("sort_column=menu_order&title_li=&child_of=".$post->post_parent ."&echo=0");
} else if($has_subpages) {
// This is a parent page that have subpages
$children = wp_list_pages("sort_column=menu_order&title_li=&include=".$post->ID ."&echo=0");
$children .= wp_list_pages("sort_column=menu_order&title_li=&child_of=".$post->ID ."&echo=0");
}
?>
<?php // Check to see if we have anything to output ?>
<?php if ($children) { ?>
<div>
<ul id="pagesubmenu">
<?php echo $children; ?>
</ul>
</div>
<?php } ?>
<!-- /SUBMENU -->
<!-- SIDEBAR CTAs -->
<div id="sidebarctas">
<? if(strstr($_SERVER['REQUEST_URI'],'/services/families/')) { ?>
<div class="sidebarctas_ctasblock" id="sidebarctas_2"><h2>Professionals</h2><div class="linkarea"><a href="<?php bloginfo('url'); ?>/services/professionals/" title="Lose weight and take charge">Professionals - Lose weight and take charge</a></div></div>
<div class="sidebarctas_ctasblock" id="sidebarctas_3"><h2>Sports Rehab</h2><div class="linkarea"><a href="<?php bloginfo('url'); ?>/services/sports-rehab/" title="Get back in the game">Sports Rehab - Get back in the game</a></div></div>
<div class="sidebarctas_ctasblock" id="sidebarctas_4"><h2>Active Retirees</h2><div class="linkarea"><a href="<?php bloginfo('url'); ?>/services/active-retirees/" title="Live a full active life">Active Retirees - Live a full active life</a></div></div>
<? } elseif(strstr($_SERVER['REQUEST_URI'],'/services/professionals/')) { ?>
<div class="sidebarctas_ctasblock" id="sidebarctas_1"><h2>Families</h2><div class="linkarea"><a href="<?php bloginfo('url'); ?>/services/families/" title="Time to get back in shape">Families - Time to get back in shape</a></div></div>
<div class="sidebarctas_ctasblock" id="sidebarctas_3"><h2>Sports Rehab</h2><div class="linkarea"><a href="<?php bloginfo('url'); ?>/services/sports-rehab/" title="Get back in the game">Sports Rehab - Get back in the game</a></div></div>
<div class="sidebarctas_ctasblock" id="sidebarctas_4"><h2>Active Retirees</h2><div class="linkarea"><a href="<?php bloginfo('url'); ?>/services/active-retirees/" title="Live a full active life">Active Retirees - Live a full active life</a></div></div>
<? } elseif(strstr($_SERVER['REQUEST_URI'],'/services/sports-rehab/')) { ?>
<div class="sidebarctas_ctasblock" id="sidebarctas_1"><h2>Families</h2><div class="linkarea"><a href="<?php bloginfo('url'); ?>/services/families/" title="Time to get back in shape">Families - Time to get back in shape</a></div></div>
<div class="sidebarctas_ctasblock" id="sidebarctas_2"><h2>Professionals</h2><div class="linkarea"><a href="<?php bloginfo('url'); ?>/services/professionals/" title="Lose weight and take charge">Professionals - Lose weight and take charge</a></div></div>
<div class="sidebarctas_ctasblock" id="sidebarctas_4"><h2>Active Retirees</h2><div class="linkarea"><a href="<?php bloginfo('url'); ?>/services/active-retirees/" title="Live a full active life">Active Retirees - Live a full active life</a></div></div>
<? } elseif(strstr($_SERVER['REQUEST_URI'],'/services/active-retirees/')) { ?>
<div class="sidebarctas_ctasblock" id="sidebarctas_1"><h2>Families</h2><div class="linkarea"><a href="<?php bloginfo('url'); ?>/services/families/" title="Time to get back in shape">Families - Time to get back in shape</a></div></div>
<div class="sidebarctas_ctasblock" id="sidebarctas_2"><h2>Professionals</h2><div class="linkarea"><a href="<?php bloginfo('url'); ?>/services/professionals/" title="Lose weight and take charge">Professionals - Lose weight and take charge</a></div></div>
<div class="sidebarctas_ctasblock" id="sidebarctas_3"><h2>Sports Rehab</h2><div class="linkarea"><a href="<?php bloginfo('url'); ?>/services/sports-rehab/" title="Get back in the game">Sports Rehab - Get back in the game</a></div></div>
<? } else{ ?>
<div class="sidebarctas_ctasblock" id="sidebarctas_1"><h2>Families</h2><div class="linkarea"><a href="<?php bloginfo('url'); ?>/services/families/" title="Time to get back in shape">Families - Time to get back in shape</a></div></div>
<div class="sidebarctas_ctasblock" id="sidebarctas_2"><h2>Professionals</h2><div class="linkarea"><a href="<?php bloginfo('url'); ?>/services/professionals/" title="Lose weight and take charge">Professionals - Lose weight and take charge</a></div></div>
<div class="sidebarctas_ctasblock" id="sidebarctas_3"><h2>Sports Rehab</h2><div class="linkarea"><a href="<?php bloginfo('url'); ?>/services/sports-rehab/" title="Get back in the game">Sports Rehab - Get back in the game</a></div></div>
<div class="sidebarctas_ctasblock" id="sidebarctas_4"><h2>Active Retirees</h2><div class="linkarea"><a href="<?php bloginfo('url'); ?>/services/active-retirees/" title="Live a full active life">Active Retirees - Live a full active life</a></div></div>
<? } ?>
</div>
<!-- /SIDEBAR CTAs -->
<? }else {?>
<div id="primary" class="widget-area">
<ul class="xoxo">
<?php
/* When we call the dynamic_sidebar() function, it'll spit out
* the widgets for that widget area. If it instead returns false,
* then the sidebar simply doesn't exist, so we'll hard-code in
* some default sidebar stuff just in case.
*/
if ( ! dynamic_sidebar( 'primary-widget-area' ) ) : ?>
<li id="search" class="widget-container widget_search">
<?php get_search_form(); ?>
</li>
<li id="archives" class="widget-container">
<h3 class="widget-title"><?php _e( 'Archives', 'twentyten' ); ?></h3>
<ul>
<?php wp_get_archives( 'type=monthly' ); ?>
</ul>
</li>
<li id="meta" class="widget-container">
<h3 class="widget-title"><?php _e( 'Meta', 'twentyten' ); ?></h3>
<ul>
<?php wp_register(); ?>
<li><?php wp_loginout(); ?></li>
<?php wp_meta(); ?>
</ul>
</li>
<?php endif; // end primary widget area ?>
</ul>
</div><!-- #primary .widget-area -->
<?php
// A second sidebar for widgets, just because.
if ( is_active_sidebar( 'secondary-widget-area' ) ) : ?>
<div id="secondary" class="widget-area" role="complementary">
<ul class="xoxo">
<?php dynamic_sidebar( 'secondary-widget-area' ); ?>
</ul>
</div><!-- #secondary .widget-area -->
<?php endif; ?>
<? } ?>
</div>
<!-- /SIDEBARAREA -->
guitarman2uk/header.php with search and social icons built in ( HTML)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>>
<head profile="http://gmpg.org/xfn/11">
<meta http-equiv="Content-Type" content="<?php bloginfo('html_type') ?>; charset=<?php bloginfo('charset') ?>" />
<title><?php wp_title( '|', true, 'right' ); bloginfo( 'name' ); ?></title>
<link rel="stylesheet" href="<?php bloginfo('stylesheet_url') ?>" type="text/css" media="screen" />
<!--[if IE 6]><link rel="stylesheet" href="<?php bloginfo('template_url'); ?>/style.ie6.css" type="text/css" media="screen" /><![endif]-->
<!--[if IE 7]><link rel="stylesheet" href="<?php bloginfo('template_url'); ?>/style.ie7.css" type="text/css" media="screen" /><![endif]-->
<?php if(WP_VERSION < 3.0): ?>
<link rel="alternate" type="application/rss+xml" title="<?php printf(__('%s RSS Feed', THEME_NS), get_bloginfo('name')); ?>" href="<?php bloginfo('rss2_url'); ?>" />
<link rel="alternate" type="application/atom+xml" title="<?php printf(__('%s Atom Feed', THEME_NS), get_bloginfo('name')); ?>" href="<?php bloginfo('atom_url'); ?>" />
<?php endif; ?>
<link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />
<?php
remove_action('wp_head', 'wp_generator');
wp_enqueue_script('jquery');
if ( is_singular() && get_option( 'thread_comments' ) ) {
wp_enqueue_script( 'comment-reply' );
}
wp_head(); ?>
<script type="text/javascript" src="<?php bloginfo('template_url'); ?>/script.js"></script>
</head>
<body <?php if(function_exists('body_class')) body_class(); ?>>
<div id="main">
<div class="cleared reset-box"></div>
<div class="header">
<div class="header-wrapper">
<div class="header-inner">
<div class="headerobject"><a href="<?php echo get_option('home'); ?>/"><img src="<?php echo get_bloginfo('stylesheet_directory'); ?>/images/header-object.png" alt="Soul Care Aesthetics covering Staffordshire and the West Midlands" title="Soul Care Aesthetics" /></a>
</div>
<!-- Contact Details -->
<div id="contact">
<div id="search">
<form method="get" id="searchform" action="<?php bloginfo('url'); ?>/">
<input type="text" value="Search this website... " name="s" id="searchbox" onfocus="if (this.value == 'Search this website... ') {this.value = '';}" onblur="if (this.value == '') {this.value = 'Search this website... ';}" class="art-searchbox" />
<input type="submit" id="searchbutton" value="SEARCH" />
</form>
</div> <!-- #end of search -->
<div id="contact-areas"><h2>Soul Care Aesthetics</h2>Cheslyn Hay, Great Wyrley, Bloxwich, Essington, Cannock, Rugeley and Wolverhampton</br>
<div id="contact-details"><span>Tel:</span> 07501 459 453</br><span>Email:</span> info@soulcareaesthetics.co.uk
</div> <!-- end of #contact-areas -->
</div> <!-- end of #contact-details -->
<div id="social">
<ul>
<li><a href="http://www.facebook.com" target="_blank" title="Facebook"><img src = '<?php bloginfo('template_directory'); ?>/images/facebook.png' alt = 'Picture' /></a></li>
<li><a href="http://www.google.com" target="_blank" title="Google"><img src = '<?php bloginfo('template_directory'); ?>/images/google.png' alt = 'Picture' /></a></li>
<li><a href="http://www.linkedin.com" target="_blank" title="LinkedIn"><img src = '<?php bloginfo('template_directory'); ?>/images/linkedin.png' alt = 'Picture' /></a></li>
<li><a href="http://www.google.com" target="_blank" title="RSS"><img src = '<?php bloginfo('template_directory'); ?>/images/rss.png' alt = 'Picture' /></a></li>
</ul>
</div> <!-- end of #social -->
</div> <!-- end #contact div -->
<div class="logo">
<?php if(theme_get_option('theme_header_show_headline')): ?>
<h1 class="logo-name"><a href="<?php echo get_option('home'); ?>/"><?php bloginfo('name'); ?></a></h1>
<?php endif; ?>
<?php if(theme_get_option('theme_header_show_slogan')): ?>
<h2 class="logo-text"><?php bloginfo('description'); ?></h2>
<?php endif; ?>
</div>
</div>
</div>
</div>
<div class="cleared reset-box"></div>
<div class="nav">
<div class="nav-l"></div>
<div class="nav-r"></div>
<div class="nav-outer">
<div class="nav-wrapper">
<div class="nav-inner">
<?php
echo theme_get_menu(array(
'source' => theme_get_option('theme_menu_source'),
'depth' => theme_get_option('theme_menu_depth'),
'menu' => 'primary-menu',
'class' => 'hmenu'
)
);
?>
</div>
</div>
</div>
</div>
<div class="cleared reset-box"></div>
<div class="sheet">
<div class="sheet-cc"></div>
<div class="sheet-body">
<?php if ( function_exists( 'meteor_slideshow' ) ) { meteor_slideshow(); } ?>
CSS Here:
/*begin page content styles*/
#col1 {
width: 60%;
float: left;
}
#col2 {
width: 36%;
float: right;
margin-left: 10px;
}
/* begin search */
#search {
position: absolute;
margin-top: 0;
bottom: 175px;
}
.searchbox {
background:#FFF !important;
color: #004b5c;
font-weight: normal;
padding:2px 0px 2px 2px;
margin:0 2px 0 10px;
border:1px solid #6B6B6B;
width:140px;
display: inline;
position: relative;
font-size: 10px;
}
#searchbutton {
font-weight: bold;
background: #004b5c;
color: #f1f6f5;
margin:0;
padding:1px 2px 1px 2px;
border:1px solid #000000;
display:inline;
width:auto;
cursor:pointer;
position: relative;
font-size: 10px;
}
/* end Search */
div.staffname {
padding-bottom: 6px;
padding-top: 0;
}
div.blurb {
margin-top: 10px;
}
#contact {
width: 300px;
position: absolute;
left: 677px;
height: 120px;
margin-top: 88px;
}
div#contact-areas h2 {
font-size: 16px;
font-weight: bold;
line-height: 23px;
}
div#contact-areas {
display: inline;
float: right;
color: #004b5c;
font: 12px/14px "Helvetica Neue", Arial, Helvetica, Geneva, sans-serif;
position: relative;
}
div#contact-details span {
font-weight: bold;
font-size: 12px;
}
div#contact-details {
display: inline;
float: right;
width: 300px;
right: 0;
bottom: -15px;
height: 10px;
color: #004b5c;
font: 17px/16px "Helvetica Neue", Arial, Helvetica, Geneva, sans-serif;
position: relative;
}
#social {
float: left;
width: 200px;
position: absolute;
bottom: 120px;
}
#social ul {
height: 50px;
width: 50px;
display: inline;
position: relative;
}
#social ul li {
float: left;
height: 50px;
margin: 0px;
position: relative;
}
#social ul li a {
float: left;
height: 50px;
margin: 0px;
position: relative;
}
#social ul li a:hover {
top: 5px;
}
#social img {
float: left;
height: 50px;
margin: 0px;
width: 50px;
}
#offers a img {
padding: 0;
margin: 0;
}
This is the header.php file from Soul Care Aesthetics - complete with CSS and social icons spaces