Skip to main content
WP Tiles

Upgrading to WP Tiles 1.0

By May 16, 2014April 12th, 2019No Comments
WP Tiles 1.0

WP Tiles 1.0 means a significant change in the features and structure of WP Tiles. Unfortunately this also means that it’s not 100% compatible with previous versions. If you are migrating from any WP Tiles version before 1.0, please carefully read the instructions below. Also, browse through the documentation on this website for more info.

In summary:

  • The shortcode has changed – prepare to replace all your shortcodes
  • Most CSS selectors have changed – your custom CSS won’t apply automatically
  • Template tags (eg. the_wp_tiles()) still exist, but need to be changed, or run in backward compat mode
  • Static menu / Tile position gist – if you you use the tile position gist, it will no longer work. An updated version will be added later

If you run into any other breaking changes. Please let me know, preferable via the GitHub repo.

Shortcode Changes

The shortcode has changed significantly and none of the old parameters are still valid. If one of the old parameters (eg. posts_query or display) is detected, WP Tiles will run in compatibility mode – ie. the shortcode will try to render using the old settings. This is not fool-proof. So expect to have to rewrite your shortcodes. The easiest way to do it is by using the shortcode builder in the editor.

  • posts_query is completely deprecated and [Display Posts Shortcode](http://wordpress.org/plugins/display-posts-shortcode/) syntax is used instead. For example: [sc]wp-tiles posts_query=”post_type=post&posts_per_page=5″[/sc] becomes [sc]wp-tiles post_type=post posts_per_page=5[/sc]
  • display is completely split up and parameter names have changed. Use the shortcode builder to recreate your settings

CSS Changes

The classes for tiles have changed completely. All classes are now prefixed with wp-tiles- and should be usable almost entirely without nesting selectors. For this reason, a custom wp-tiles.css will no longer be loaded from your theme (it would completely break the plugin). To override the WP Tiles css, return its path to the wp_tiles_stylesheet filter. Eg.:

add_filter( 'wp_tiles_stylesheet', 'my_theme_wp_tiles_styleheet' );
function my_theme_wp_tiles_styleheet() {
	return get_stylesheet_directory_uri() . '/css/wp-tiles.css';
}

To disable the WP Tiles stylesheet, return `false`:
add_filter( 'wp_tiles_stylesheet', '__return_false' );

Template Tags

Only the_loop_wp_tiles without parameters should work unchanged and in compatibility mode automatically. Both the_category_wp_tiles and the_wp_tiles now expect 2 parameters – $posts and $options. If you pass false for $options the template tags will run in compatibility mode. For example:

the_wp_tiles( array(
              'display' => array( ... some arguments ... )
), false );

Otherwise, documentation on the $options array will follow later. Use it to convert your template tags to WP Tiles 1.0.

Please note: the backward compatibility layer will be removed from the plugin in due time. Make sure you make your website compatible with WP Tiles 1.x