Meet Orvis

Introducing Orvis: a minimalist portfolio theme for photographers, designers, or visual artists. Activate Jetpack’s Custom Content Types module to display portfolio projects in a contemporary Masonry grid.

Designed by Automattic’s Thomas Guillot, Orvis was inspired by the photographer wife of a colleague/friend, and named as a nod to their dog, a sweet black Lab.

Take Orvis for a ride on your site today!

Orvis screenshot

New Themes: Escutcheon & Toujours

Two new themes are available for download in the WordPress.org theme repo: Escutcheon and Toujours.

Escutcheon (pronounced ess-KUH-chun) is a bold, typography-driven theme for long-form writers to showcase their work. Designed by Mel Choyce and developed by Caroline Moore, Escutcheon — an unusual word referring to a type of shield — supports a social icon menu and displays post excerpts on the front page.

Escutcheon screenshot

Laurel Fulford crafted Toujours (French for “always” — pronounced too-DJOOR) as a responsive remake of the popular Forever theme. Geared to weddings, it features a large slider (available via Jetpack Featured Content), a unique layout for three recent posts, and a special guestbook template.

Toujours screenshot

Whether you’re planning upcoming nuptials or getting down to serious blogging, we welcome you to take Toujours and Escutcheon for a spin.

Restricting User Content: A Dialogue Among Themers

I had a Slack chat with my colleagues recently that we thought might be of interest to other themers.


Ernesto: I have a small theming question I’d like to clarify. Let’s say I have a page that is used as front page and there’s a section in the front page that displays some text. I can display the page’s content there, using the_content(), but I would only want there to be text — no fancy shortcodes or custom content, just basic formatting.

Would you create your own content filter for that section? Something like adding wpautop, convert_smileys, and wp_kses_post (possibly others too, if they make sense) into that filter? Or just use the_content() ?

I am leaning towards the filter approach, since it may give me what I want, without giving users full liberty to put all sorts of things into a div that is supposed to hold some minor text and content.

Tammie: This feels like a UX issue too. Why are you restricting?

Ernesto: Because it’s not a full content post, it’s a space where there should be one or two paragraphs at most. Just some introductory text.

theme screenshot

Tammie: Then why let full content appear anyway? Post restricting is expected behaviour, page restricting isn’t. Let’s not add a new behaviour.

I’d say the_content() and if user messes up, well…

If you limit that it’s adding a new behaviour.

Ernesto: Yeah, that makes sense.

Caroline: I’d agree with keeping it as simple as possible.

Tammie: Maybe they want to add a link. Adding a link there is a totally expected thing.

Caroline: So, the_content() works:-) And then with [the new content settings feature we’re working on] they could change it to the_excerpt() someday soon.

content-settings

Tammie: Yep, win win.

Ernesto: Very good point… I see no problem with using the_content(), but since I know users want to add everything + the kitchen sink, I was just trying to avoid that.

Caroline: Hahaha.

Ernesto: So yeah, win win.

Tammie: Well that’s assuming they do. Many don’t.

Technically the ones that do make up for ones that don’t😉

David: Yeah, the_content() all the way.

Kathryn: Agreed 100%.

Ernesto: It’s interesting knowing your thoughts on this😀

David: If they put too much content in there, make the theme break elegantly.

Kathryn: If user wants to make their site busy, let them do it.

Kathryn: Users shouldn’t put a zillion widgets in one widget area, but we let them do that😉

Ernesto: Hehe, let them break and then tell them well… you shouldn’t do that.

David: It’s our job as developers to make themes that just work. Part of that is making edge cases not blow up a theme.

Tammie: Well, there’s hand holding and there is spoon feeding. Hands > spoons.

Kathryn: Very much agree re: “Part of that is making edge cases not blow up a theme.”

Also, making cluttered/ugly is different than “breaking”.

Ernesto: I think this is a very good & mature way of thinking… adding stuff for edge cases just makes the theme bloated.

Tammie: Also, edge cases aren’t always bad. We tend to have edge PTSD.

Kathryn: And there’s so much in between cluttered and minimal that is going to look just fine, I think.

Tammie: Yep.

Ernesto: Right, very good discussion and input, thank you so much, that’s why I love y’all:-)

Tammie: Also I kind of love the fact you didn’t even suggest a theme option for that.

Kathryn: Ha.

Ernesto: Hahaha.

Tammie: Times have changed and I like them.

Ernesto: I was going to admit it crossed my mind, but then noticed a page would be cleaner.

Tammie: And that’s why I have even more love about it. Self correcting rocks.

Ernesto: “If they put too much content in there, make the theme break elegantly.” – David Kennedy: Seriously?

David: Yep, I think that’s a sign of theme greatness.

Ernesto: That’s right, the I did what I could to hold the user’s content attitude, I like that too. Definitely adding some float-clearing there.

David: Before this, I worked at a place with a giant, talented editorial team. I thought, Perfect, we can work with them to get exactly the content we need! But they found ways to break things all the time. So whether you know the content, or don’t know it, make it highly fault tolerant.

Ernesto: Very very good advice, thank you!

Sleek Pique

Pique (pronounced “peek”) made its debut in the WordPress.org repository this week. A spiffy scrolling front-page theme crafted by Automattic’s Sarah Semark, Pique lets you add up to eight panels to the homepage by choosing static pages via the Customizer.

Designed with coffee shops in mind, Pique is a great fit for many types of small businesses. It supports a logo or customer testimonials with Jetpack and can display a custom menu in both the header and footer. Check it out!

Pique screenshot

Consider Canapé

Looking for a fresh, elegant theme for a restaurant or other food-related site? Explore Canapé, now available in the WordPresss.org theme repo. Designed by Automattic’s Ola Laczek, Canapé retains its sophisticated look on mobile, tablet, and desktop screens.

Add features like food menus and customer testimonials with Jetpack, and showcase up to three food-menu sections on the homepage.

Check out the Canapé demo or download it and start experimenting.

canape_ss

Show the Latest Featured Image from Featured Content

For the latest ThemeShaper remake, we added Featured Content to Twenty Sixteen. That’s standard, but our design called for not showing the featured image of every post, but only the latest post. That image serves as a backdrop to our collection of featured posts, which can be from one to three posts at a time. It’s a neat design pattern, so I thought I’d share the code needed to grab that image.

First, I assume you have featured content set up like the example code from the Jetpack documentation suggests. Next, let’s write a function to grab that image:

function mytheme_get_first_featured_featured_image() {
	$featured_posts = mytheme_get_featured_posts();
	if ( is_array( $featured_posts ) && ! empty( $featured_posts ) ) {
		$post_id = (int) $featured_posts[0]->ID;
		if ( has_post_thumbnail( $post_id ) ) {
			 $big_post_image = wp_get_attachment_image_src( get_post_thumbnail_id( $post_id ), 'mytheme-custom-image-size' );
			 printf( 'style="background-image: url(%s);"', esc_url( $big_post_image[0] ) );
		}
	}
}

Using it in your theme:

<div id="featured" class="featured-posts" <?php mytheme_get_first_featured_featured_image(); ?>>

<!-- Other stuff -->

</div>

A few notes about what’s happening in the code above:

  • First, we need to grab the featured posts, and check to make sure there are some posts.
  • If there is, we assign the post ID of the latest post to a variable, $post_id. We’ll need that later.
  • Next, if the latest post has a post thumbnail, we create another variable, $big_post_image, and use it to assign the actual output of the image URL.
  • Finally, we output the markup. It outputs as a style attribute, and you can then style the rest via CSS. In your theme, you just attach the function to the div or html element you want to apply the style on.

That’s it! Hopefully, this code snippet helps you in the next theme you create. Happy theming!

ThemeShaper v.2016

If you’re a regular reader, you’ve probably noticed that things look a little different around here.

The last ThemeShaper remake took place three years ago — it was definitely time for an update! We crafted a child theme of Twenty Sixteen to take advantage of its fresh design and typography, while putting our own spin on it with the addition of Featured Content and footer-widget areas. A subtle grey color scheme and the Bitter and Lato Google Fonts round out the new look. Code snippets are now easier to read and our Twitter account is a little more intuitive to find, too.

We hope you like it! If you notice anything that doesn’t look right, feel free to let us know, either in the comments or by getting in touch directly.

Beguiling Button

Designed by Automattic’s Caroline Moore with crafters and hobbyists in mind, Button features detailed accents, featured images, gallery slideshows, and a soft color palette. With Jetpack active, you can add a logo for extra flair. Now available in the WordPress.org directory, Button is the perfect theme for a blog showing off your sewing skills, chronicling your latest DIY endeavors, or keeping a running list of your favorite things from around the web.

Button screenshot

Jetpack Social Menu

With the release of Jetpack 3.9 last month, we introduced a new tool available for all theme developers: Social Menus. It allows site owners to create a new menu location which is used to display links to Social Media Profiles.

Adding Support

Theme developers can add support for a Social Menu by following these three simple steps.

Step 1: Declare support in a function hooked to after_setup_theme.

add_theme_support( 'jetpack-social-menu' );

Step 2: Create a new function to avoid fatal errors if Jetpack isn’t activated.

function themename_social_menu() {
	if ( ! function_exists( 'jetpack_social_menu' ) ) {
		return;
	} else {
		jetpack_social_menu();
	}
}

Step 3: Use the function created in step 2 to output the menu where you would like it displayed in the theme.

themename_social_menu();

Styling

Once you’ve created a menu, Jetpack will automatically enqueue a basic stylesheet to style each one of the menu items, thanks to Genericons. You don’t have to do anything else!