Home > Help Center > Applications > WordPress > Jetpack > Jetpack Modules: Portfolios

Jetpack Modules: Portfolios

The Portfolio custom post type (CPT) gives you an easy way to manage and showcase projects on your site that does not necessarily fit into a post, but isn't right for a static page either.

Switch on the Custom Content Types module in Jetpack > Settings > Writing:

jetpack portfolio

To enable Portfolio CPT for your site and to set how many projects to be displayed per page, go to Settings > Writing and check the Portfolio Projects option under Your Custom Content Types.

jetpack portfolio

Now you will notice a new link Portfolio in your Dashboard menu where you can manage all your projects in one place separate from your blog posts and pages:

jetpack portfolio

Enable Portfolios Excerpts

Portfolios don't support excerpts by default. You can enable the support by adding the following code in functions.php file in your theme:

/**
 * Add Excerpt support to the Portfolio Custom Post Type.
 */
function jetpack_custom_excerpt_portfolios() {
  add_post_type_support( 'jetpack-portfolio', 'excerpt' );
}
add_action( 'init', 'jetpack_custom_excerpt_portfolios' );

Update the file and enable the Excerpt in Screen Options.

Adding and Managing Portfolio Projects

You can add a new project under Portfolio > Add New in the similar way your are adding regular WordPress posts.

Portfolio projects are ordered by the date they're created, with the most recent project displayed first. Adding a Featured Image and Custom Excerpts to each project is highly recommended, as it lets themes and the portfolio shortcode display your projects in a more visual manner.

Along with the Portfolio content type, there are two ways of categorizing your projects: Project Types (similar to Categories) and Project Tags (similar to Tags).

For our example we are using one of the default WordPress themes twentyeleven.

This theme supports featured images in an interesting way - when a single page is displayed the featured image of that post shows up as a header image if the original featured image is wider than 1000 pixels.

jetpack portfolio

Portfolio projects also support Comments to allow readers to interact with you and the Publicize feature that allows you to share your projects to a number of social networks automatically.

Now we will add a new post in Posts > Add New with title Guitar Expo and we'll enter just the shortcode [portfolio] in the text box.

jetpack portfolio

One last step - let's add our projects to the main menu.

Go to Appearance > Menus and do the following:

  • From the Posts pane select Guitar Expo and click Add to Menu
  • Click the Projects pane, select all four projects and click Add to Menu
  • Drag each project pane slightly to the right - this way all projects will become part of a dropdown menu under Guitar Expo link
  • Click Save Menu:

jetpack portfolio

jetpack portfolio

Now let's visit the site:

jetpack portfolio

If you click on the project title or on the Continue reading link, the project page will open.

jetpack portfolio

View Portfolio Projects

There are a few different ways to view your portfolio projects.

The following links are created automatically once you add portfolio projects, types, and tags.

  • Portfolio Archive – yoursite.com/portfolio/
  • Single Project Page – yoursite.com/portfolio/electric-guitar/
  • Project Type Archive – yoursite.com/project-type/guitars/
  • Project Tag Archive – yoursite.com/project-tag/electric/

Note: make sure there are no posts, pages, categories, or tags called portfolio, otherwise your projects may not display as intended.

Portfolio Shortcode

The Portfolio content type comes with a shortcode to let you display projects on posts and pages. [portfolio] embeds an archive view of your portfolio projects.

The shortcode will display projects in different ways, depending on how you use the optional attributes to customize the portfolio layout.

Portfolio Shortcode Attributes

  • display_types: display Project Types – displayed by default. (true/false)
  • display_tags: display Project Tag – displayed by default. (true/false)
  • display_content: display project content – displayed by default. (true/false)
  • display_author: display project author name – hidden by default. (true/false)
  • include_type: display specific Project Types. Defaults to all. (comma-separated list of Project Type slugs)
  • include_tag: display specific Project Tags. Defaults to all. (comma-separated list of Project Tag slugs)
  • columns: number of columns in shortcode. Defaults to 2. (number, 1-6)
  • showposts: number of projects to display. Defaults to all. (number)
  • order: display projects in ascending or descending order. (ASC/DESC)
  • orderby: sort projects by different criteria, including author name, project title, and even rand to display in a random order. Defaults to sorting by date. (author, date, title, rand)

Example

[portfolio columns=3 showposts=6 orderby=title]

The example will display up to six portfolio projects in three columns, in ascending alphabetical order by project title.

jetpack portfolio

Troubleshooting

If any of the Portfolio page links result in a Page Not Found error, this can be fixed by disabling and re-enabling the Portfolio content type.

Go to Settings > Writing > Custom Content Typesuncheck the Portfolio Projects option, save your changes, and then re-check the Portfolio Projects option and save your changes again.

#jetpack #tools

Still not finding what you're looking for?

Contact our support team with any additional questions or concerns.

Contact support