.post-date { display: none; }
All posts by
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"); […]
Links
Google Fonts
Using Google Fonts Offline Find the font you want to use and find the Google recommended link to use (in the “Standard” tab). e.g. <link href=’http://fonts.googleapis.com/css?family=VT323′ rel=’stylesheet’ type=’text/css’> Enter the URL portion into your browser and get the resulting css, e.g. http://fonts.googleapis.com/css?family=VT323 gives: @font-face { font-family: ‘VT323’; font-style: normal; font-weight: 400; src: local(‘VT323’), local(‘VT323-Regular’), url(http://themes.googleusercontent.com/static/fonts/vt323/v4/LfMzj2MWAZU6qzlnp1MNbg.woff) […]
