Updates from August, 2011 Toggle Comment Threads | Keyboard Shortcuts

  • Sam Margulies 4:46 pm on August 18, 2011 Permalink | Reply  

    Need to login? Just hit escape. 

    Starting today, you can login to any  WordPress site at Temple SCT by clicking the escape key. After logging in you will be brought right back to the page you were on.

    This functionality comes from the clever folks at Red Sweater Software, who have introduced QuickLogin for WordPress (which was itself inspired by Squarespace.) I did need to make some simple changes to get it working with WordPress Multisite, but I couldn’t wait for a fix from the developers to enable this functionality. Once I started logging in with one key, I became addicted. Try it out for yourself on any SCT page.

     

     

    Leave a Reply

    Your email address will not be published. Required fields are marked *

    *

    HTML tags are not allowed.

  • Sam Margulies 6:15 pm on February 25, 2011 Permalink | Reply  

    New Custom Field Query Options 

    One new feature of WordPress 3.1 that will help me with several projects I’m working on is the new custom field query system. This allows you to query multiple custom fields and with more filtering options. For instance, on the TUTV site we display a schedule of upcoming shows. To do this, we add a custom field to posts in a custom post type for schedule items. Previously, there was no easy way to easily organize upcoming showtimes so that only one day appears at a time. With the new meta_query options, I can simplify the schedule query to:

    $args = array(
    	'post_type'=>'events',
    	// our new custom field query syntax
    	'meta_query' => array(
    		// note that the actual query array must be wrapped in 
    		// another array. This allows for multiple queries.
    		array(
    			//formerly 'meta_key'
    			'key' => 'date_value', 				
    			//formerly 'meta_value.' This can be a string or an array of values
    			'value' => array($start_of_schedule_day, $end_of_schedule_day), 
    			// compare can be 'LIKE', 'NOT LIKE', 'IN', 'NOT IN', 'BETWEEN', 'NOT BETWEEN' 
    			// and the previously used '!=', '>', '>=', '<', or '<='.
    			'compare' => 'BETWEEN'
    		)
    	),
    	'orderby' => 'meta_value',				
    	'order' => 'ASC',
    	'posts_per_page' => '48',
    );
    query_posts( $args );
    

    The codex documentation for this feature also mentions that a ‘type’ may be specified:

    type (string) – Custom field type. Possible values are ‘NUMERIC’, ‘BINARY’, ‘CHAR’, ‘DATE’, ‘DATETIME’, ‘DECIMAL’, ‘SIGNED’, ‘TIME’, ‘UNSIGNED’. Default value is ‘CHAR’.

    I’d love to hear if anyone has any other creative uses of this new feature or how to use the ‘type’ attribute.

     

    Leave a Reply

    Your email address will not be published. Required fields are marked *

    *

    HTML tags are not allowed.

  • Sam Margulies 3:02 pm on February 16, 2011 Permalink | Reply  

    Custom Login Image 

    I just setup a custom logo show when someone logs into this site. This is a simple change but makes your site look much more professional and consistent.

    How to set it up

    First, add the following code to your functions.php file:

    <?php
    function childtheme_login_head() {
    ?>
    <style>
    body.login #login h1 a {
    background: url('<?php bloginfo('stylesheet_directory'); ?>/images/logo-login.png') no-repeat center top;
    height: 72px;
    }
    </style>
    <?php
    }
    add_action('login_head', 'childtheme_login_head');
    ?>

    Then, just add a file named logo-login.png to the images directory within your theme. The image should be 300px by 72px.

     

    Leave a Reply

    Your email address will not be published. Required fields are marked *

    *

    HTML tags are not allowed.

c
compose new post
j
next post/next comment
k
previous post/previous comment
r
reply
e
edit
o
show/hide comments
t
go to top
l
go to login
h
show/hide help
esc
cancel