I’ve used custom post types to display portfolio items since WordPress 3.0 when they were first introduced.
Portfolios work well as a custom post types because they generally aren’t displayed in the regular feed (like posts), they usually need a taxonomy (which isn’t done in pages by default), and as a custom post type its easier to give them their own metaboxes (like a project link, or image).
However, if you register a “portfolio” post type directly with the theme- whenever you change themes you’ll need to copy over the code code. And since I just recently did this, I thought I might as well release my code as a plugin and let other folks do it as well.
What This Plugin Does
The Portfolio Post Type Plugin will:
- Registers a new portfolio post type
- Registers separate portfolio taxonomies for tags and categories
- Displays the portfolio image in the dashboard column view
What This Plugin Doesn’t Do
This plugin won’t handle any of the front end display of your post type. If you want to style those or change the layout, you’ll probably want to add archive-portfolio.php and single-portfolio.php to your theme.
When You Shouldn’t Use This Plugin
If you want your portfolio items to go out in the regular feed, or be displayed alongside posts- you’ll likely want to use post formats instead. With a post format you can set your post as an “image” or a “gallery”, and even display it differently on the front end using custom templates. Here’s a link to the codex about post formats.
How Does the Code Work?
I wrote a full explanation of the plugin code over here.
I am using Portfolio Post Type with the Portfolio Press theme since there are ready-made templates. The portfolios are being used to feature artists, artisans and musicians for our upcoming Summer art show. We are also featuring our show sponsors in the portfolio section. The problem is that when using the navigation arrows inside the “single-portfolio.php” template, there is no separation between the artists and sponsors. I would prefer to have them in separate sections.
If I were to duplicate the plugin folder to create a “Sponsor” custom post type, which files would I need to modify? I assume most of the heavy listing is done by “portfolio-post-type.php” but there are other files inside the “includes” folder. Obviously I would need to create content-sponsor, single-sponsor and archive sponsor templates. I am working inside a child theme so there is no danger of the files being overwritten.
Thanks.
[…] Use or make a portfolio custom post type […]
Hi, I just did a bunch of updates last night and now the portfolio items don’t show up on the home page (as they used to). There is just one light grey box with a picture symbol (mountains and sun) in it where before it displayed my 9 portfolio items. How can I get this working again? Many thanks in advance!
I’m not sure what happened, but my portfolio press portfolio tag and categories navigation is suddenly missing. I can’t alter or add anything to the wp nav menus. I wonder if it was something that got lost in updates? Any help or advice you or anyone reading might provide would be awesome.
Is the plugin still active? Did you check “Screen Options” in the menu admin?
I´m building a site with the story template and the portfolio plugin. Im using the qTranslate X to have the site in Norwegian (main) and in English. Almost everything seems to work fine except the Portfolio gallery page. Once you open a product [:NO]NORGRIP SKLISIKRING[:EN]NORGRIP ANTI-SLIP[:] this this comes up. If I do press reload page it disappears and works perfectly. Could you please help me?
web page name is http://www.glassfiber.no
Thank you so much
Hi
Firstly thank you so much!
There is a problem about permalinks. Your plugin working with only default permalinks.
any idea ?
thanks
It should work with all permalink structures. Make sure you don’t have any other plugins or pages trying to use the same slug. Also, try re-saving your permalinks.
Hi!
thank You for this perfekt working plugin!
I want to chance the word ‘portfolio’ in the browser path.
Is this possible? Do You have any idea?
All the parameters are filterable. The post type slug is set here: https://github.com/devinsays/portfolio-post-type/blob/develop/includes/class-portfolio-post-type-post-type.php#L71
Thanks for the plugin.
How do I apply your answer?
I’ve tried this:
apply_filters( 'portfolioposttype_category_args', array('rewrite'=> array( 'slug' => '' )));
Didn’t work.
Thanks
Rani
You don’t want to apply_filters, you want to add_filter.
Hello Devin,
Thank you for the awesome plugin, and Portfolio Press theme. I’ve been tweaking your theme to fit my purposes, and I’m hoping you can point me in the right direction. Right now I’ve got a static home page that is using a modified version of your full-width-portfolio template to display four image thumbnails that link to different portfolio_category pages. There’s a carousel I’d like to use that only works with image galleries, so I’m trying to figure out how to get the full-width-image-gallery-formats template to act similarly to those /portfolio_category/ pages.
The simplest way I can think of (although not the most elegant) is to make different templates (based on your image-gallery template), in which I modify the WP_Query to return the appropriate items. To that end, can you tell me how I might access the portfolio post type category taxonomy in WP_Query?
Thank you for your time.
– Jordan
Any advice for me on getting “Older posts” to function here http://supah.com/
I am lost and I don’t know how to fix this.
Hi. I just installed your plug in because I wanted to assign different pages to different portfolio categories. I can’t seem to be able to assign a specific portfolio category to a certain page. My theme (scope) still only allows me to select a general portfolio and your plug in did not add further detail so that I can select the specific portfolio category I want displayed.
Does the plug in not function this way?
The plugin automatically creates archives for the portfolio categories. Go to you Menu admin, check the “Screen Options” tab and make sure the “Portfolio Category” box is checked, and then you should be able to add those to your menu (and find the URL!).
I’m so sorry I’m a bit of a newby at this. I’ve followed all the instructions and my portoflio page looks fantastic! I’d just like to make one change to the style which I know involves code, I’d like to have the images in full colour all the time without having to hover over them for them to be in full colour. Would you be able to help me at all?
Is there a way to show the portfolio tags in a page? Maybe with a shortcode? I have entered a couple of tags for this page, but I can’t figure out how to get them to show in the page. http://folio.johnschwegel.com/portfolio/rusty-zombie-robot/
No shortcode. You’ll need to use https://developer.wordpress.org/reference/functions/get_terms/.
Thank you for your plugin! Wonderful job!
I have some problems and wishes:
1. Icon of plugin parameters and options in screen options is missing
2. I use Masonry Mode Gallery in Columned item type. But that all correctly displayed I have to choose Item type – “Side portfolio”, then I turn to the section “Side Portfolio” and check the checkbox – “Masonry Mode Gallery”. Then I must publish post, and then I choose “Columned” Item type and again publish post ;) Unfortunately the only right way to do Masonry Mode Gallery in Columned item type.
Add please checkbox “Masonry Mode Gallery” for Columned item type
3. Very slow scrolling in “portfolio gallery” section.
also in new versions I would like to see the ability to bulk add photos.
is this support elementor? or beaver builder?
No.
Hey. Elementor Pro Have released an update where you can create and edit Archive Pages + Heade + Footer and everything.
I have managed to get a pretty good job with it and with your plugin.
Yet the ONLY thing that is missing is changing the Title of the Portfolio page.
I’ve searched on every option on this website and didn’t find how to change the (SEO) Title of the Portfolio page.
because it looks terrible on Hebrew website breadcrumbs.
its looks like this
https://imgur.com/a/9cKTQLG
It will be MASSIVE if you could create this pages and just save us all some time…
thank you so much!
My guess is that the breadcrumbs plugin is using post type label. So, I’d try submitting a Hebrew translation for the plugin:
https://translate.wordpress.org/projects/wp-plugins/portfolio-post-type/contributors
Well, How can I add a translation to this plugin?
I have WordPress.com User and still I can’t seem to find the “Add A Translation” button or something like that
because based on that link
https://translate.wordpress.org/projects/wp-plugins/portfolio-post-type/stable/he/default?page=4
it seems like the “Portfolio” have been already translated
And on the Yoast SEO plugin, I can’t seem to find anything translateable… so…
Well.
I found.
I just changed this file
portfolio-post-type/includes/class-portfolio-post-type-post-type.php
and the names of it.
thanks!
Hi Davin,
Thank you for the plugin. I am trying to figure out how to:
1: Link more than one portfolios together. So if I press on a picture of a logo then I can end up at the portfolio of the whole project. Is that possible? I checked the “Parent Portfolio Page” in the portfolio item, but that didn’t seem to be it. Or I am doing it wrong.
2: Block the possibility to go in and see the portfolio item when the featured image is in display on the website. To take away the plus. I know that is possible to take away that it is showing the plus on the featured image but still when I press it you get into the portfolio. Is it possible to take the link away?
Cheers,
Anna
You’d need to custom code something like this, but it is possible. https://wptheming.com/2012/08/display-the-most-recent-post-in-each-category/
The plus is being displayed by your theme. So, likely possible to remove with some CSS.
Hi, can you tell my why the gallery doesn’t show all the portfolio item i have please? It does when I click ALL categories. (Shown on cocktails page)
Also, can I change the order of the categories displayed?
One last thing, the gallery does not show any items on a mobile, unless you click one of the categories. Many thanks
Hi, can you help me please? I want to display number of post in portfolio category from this plugin. It is possible?
I’m trying to add google analytics to the pages built using this portfolio plugin, but am seeing no where within the plugin to add the GA code. Is there a place I can add GA using the plugin or do I just need to install it within the overall theme?
Generally you would use a plugin to add Google analytics code. Some allow you to specific which post types to exclude or include.
Hi Devin,
I’m trying to use the portfolio post type to show portfolio pages for my camera club. The thing is we have around 70 entries per month, and as I need to show them in the masonry format, I need to add them to the “columned” style ONE AT A TIME! Is there no way for me to have a masonry style portfolio where I can select multiple items from uploaded media instead of one after the other?
I have around a year and a half worth of portfolios to create, which is almost a thousand images.
You insert a gallery into posts or pages. Maybe that would work better for you?
Hi Devin,
sorry if my questions might sound silly. I googled a lot but still could not find any solution yet.
How can I add categories slugs in my portfolio items?
I would like my portfolio URLs to look like:
http://www.mywebsite.com/portfolio/category/portfolio-item-1
At present URLs are as follows:
http://www.mywebsite.com/portfolio/portfolio-item-1
Moreover, I would like to hide dates on my portfolio items page, but keep them on my articles page, but my WP theme seems to treat article and portfolio items the same way.
Can you please help me?
Hi Lisa. Go to your menu screen under “Appearance > Menus” and click the “Screen Options” tab in the upper right. That will allow you to select portfolio taxonomies to display.
To hide dates, you’ll likely need to customize the theme. I’d contact your theme author or use the WordPress.org forums to get advice on this.
Hi, thanks for the plugin! It is possible to customize the url and change “/ portfolio_category” to another name.
Hi, yes. See the section about “Customization” in the readme: https://github.com/devinsays/portfolio-post-type
Hi Devin, I changed portfolio labels through pasting code from the github link you provided and my slug is successfuly changed, however, when I try to open one of the single posts withe the new slug I get 404 Error -> can you guess what might be the case here ?
Try refreshing your permalinks. Go to Settings > Permalinks and click “Save”.
Devin,
Thanks for the plugin. I am here to report a serious issue. When you activate the plugin, the excerpt field for all post types in wp rest api is replaced with `… ` . Please kindly fix this issue. Thanks.
Hello Devin,
I’have the 5.5 version of WordPress.
I’ve installed the plugin and put the code into the Theme Functions.php
I added the projects into first portfolio.
Now how I can put the Portfolio on the Home page?
Do I have to write something? [portfolio] doesn’t works
In blocks options doesn’t appear any icon for insert the Portfolio post type.
thank you in advance.
Best.
Hi, we’ve noticed that in the latest version of WordPress the Portfolio plugin is no longer being declared correctly, to allow duplicate post functionality to work.
Could you possibly update the plugin so it’s compatible?
Thanks
Do you have any plans to update this plugin in the future?
I have a security plugin that is “concerned” that there’s no, recent updates. Does this plugin still work correctly as is, or should I remove it? And if I do, will it affect my story themed website?
It still works!
Do you have any shortcode from portfolio-post-type plugin?