Good Resources http://www.w3schools.com/css/css3_gradients.asp A Left To Right Colour Fade #header { background-color: #045d31; background: -webkit-linear-gradient(left, #045d31, #abe1a5); /* For Safari */ background: -o-linear-gradient(right, #045d31, #abe1a5); /* For Opera 11.1 to 12.0 */ background: -moz-linear-gradient(right, #045d31, #abe1a5); /* For Firefox 3.6 to 15 */ background: linear-gradient(to right, #045d31, #abe1a5); /* Standard syntax */ }
All posts by
Classes Of Things
Referring To The Class Name Of Specific Tags Hide the li class "comments" in ul "meta-single": ul.meta-single li.comments { display: none; }
Hide Items Using CSS
.post-date { display: none; }
Strings
Null or Empty Strings An empty field can be either an empty string or a NULL. Is field is not empty AND not null (i.e. it has an actual string in it): WHERE field_name > '' Is field is empty OR null: WHERE IFNULL(field_name, '') = ''
.Create A Child Theme
Creating A Child Theme This allows you to modify a main theme but still allow the main theme to be updated. The main guide: http://codex.wordpress.org/Child_Themes Creating The New Theme 1. Creat a new directory for the child theme, typcially “main_theme_name-child” 2. Create a file called “style.css” and paste this into it: Change to match the theme […]
Using Null
$MyArrayValue = isset($MyArray[‘some_name’]) ? $MyArray[‘some_name’] : ”;
Posts Based On Date
Only Get Posts With A Date After Yesterday $args[‘date_query’] = array( 'column' => 'post_date_gmt', 'after' => 'yesterday' );
Adding Arguments Before The Loop Starts
<?php global $query_string; query_posts($query_string . "&orderby=ID"); /*Adding this line causes order by post ID instead of date*/ ?> <?php while ( have_posts() ) : the_post(); ?> <?php get_template_part( 'content', get_post_format() ); ?> <?php endwhile; ?>
Centered Page
Basic Centered Page <style type="text/css"> .page_main { width: 800px; margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 6px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; } </style> </head> <body> <div class="page_main"> </div> </body>
Maths based results
This is PHP4 Code! Get Number of Results $query1 = @mysql_query("SELECT COUNT(*) FROM some_table WHERE some_column != 1"); $number_of_rows = @mysql_fetch_array($query1); $number_of_rows = $number_of_rows[0]; echo "This many: $number_of_rows"; Results Based On An Average Score Calculation $query1 = @mysql_query("SELECT university_name, CONVERT((score / games_played), UNSIGNED INTEGER) as ave_score FROM tbl_universities ORDER BY ave_score DESC, university_name ASC"); […]