WordPress Designers and Developers in Minneapolis, MN

“first-child” vs. “last-child” Pseudo Class in CSS3

I have a navigation menu that adds a pipe after each menu item using the “border-right” CSS class.  Unfortunately, IE does not play nice with the “last-child” pseudo-class that I was using to remove the pipe from the last element.

The solution to the problem was to reverse my thinking, and use the “border-left” CSS class along with the “first-child” pseudo-class.  For some reason, the “first-child” pseudo element was included in the CSS2 definition and has wide cross-browser support.  The “last-child” class, however, is a CSS3 definition and enjoys only a fraction of “first-child”‘s cross-browser support.

Thanks to: http://stackoverflow.com/questions/1293369/using-last-child-in-css/2298443#2298443

Calendar Plugin Update

We are making the best calendar plugin we can fathom.  Adrienne and I have been meeting weekly to check in on each other’s updates in this regard.  Updates this week include:

  • We have a name for the plugin!  It is still top-secret until we get some branding done, but rest assured, it will be cowboy-tastic!
  • We still don’t know where or how we are going to sell the thing.  We are checking out wpplugins.com and codecanyon.net as well as some in-house options.
  • I recoded the plugin to reflect the new name.
  • We are building out some unique features, which will be unveiled once we figure out our marketing plan.
Please let us know if you have ideas or suggestions on features and calendar needs that are going unmet.

 

How to Enable Features in an Existing WordPress Custom Post Type

I was working on a slideshow tonight in a custom WordPress theme and wanted to use Meteor Slides. The only problem is that Meteor Slides does not come with the post editor enabled. So, I used the “add_post_type_support()” function to enable it:

 
<?php
	add_action('init', 'my_custom_init');
 
	function my_custom_init() {
		add_post_type_support( 'slides', 'editor' );
	}
?>

And whallah! Now Meteor Slides supports the post editor!

Note: Make sure to change “slides” to whatever custom post type you want to enable the features on.

WordPress Calendar Plugin Update

Progress has been steady on our new WordPress calendar plugin.

Tonight I packaged a simple list widget with the plugin and have it running in the sidebar on MSP WordPress.

The admin interface is looking pretty sweet.

Adie and I have decided to make this the easiest-to-use calendar plugin ever. It is going to be so easy to use that you will wonder why nobody did it before – at least that is our goal.

Our design strategy is one of minimalism with a robust API. So, out-of-the-box it will have very few features, however, plugin developers will have lots of fun adding features via hooks and filters.  We recognize that some people want an event plugin that does all sorts of crazy things out of the box.  There are already a number of plugins that cater to that crowd, and we feel that in addressing all sorts of random functionality, those plugins have sacrificed design and usability.

We have a solid wireframe and a working prototype. We are meeting on Friday to (hopefully) finalize a name for the product, and then we expect the next step will be a first design iteration with an actual artist.

Last Friday we met and came up with 100 possible names, before winnowing that list down to 15 of our favorites.

Fun times!

How to Add Plugin Scripts and CSS to a Specific Custom Post Type

I am working on a new calendar plugin for WordPress and discovered that my jQuery scripts and CSS were loading on every page in the admin. Whoops!

The solution was to include my scripts in the following manner:

// Only load the scripts and css on the a specific custom post type in the admin
add_action('admin_init','load_my_script');
function load_my_script() {
  global $pagenow, $typenow;
  if (empty($typenow) && !empty($_GET['post'])) {
    $post = get_post($_GET['post']);
    $typenow = $post->post_type;
  }
  if (is_admin() && $typenow=='add_your_custum_post_type_name_here') {
    if ($pagenow=='post-new.php' OR $pagenow=='post.php') { 
      require ( dirname(__FILE__) .'/add_your_scripts_loader_file_here.php' );
    }
  }
}

I have discovered over the years that many plugins fail to include their scripts in this manner, which can cause all sorts of weird things to happen in the admin.

Enjoy!

Thanks to Mike for the answer.