- This topic has 17 replies, 4 voices, and was last updated 2 years, 5 months ago by David.
-
AuthorPosts
-
November 9, 2021 at 2:46 pm #1997883Eva
Hi,
Using CPT UI I created the custom post type Portfolio. I created a content template for my single portfolio items, using the Block Elements module and Dynamic Data. Still a very simple set up, but wow, it’s great!!
The only thing I would like is, to be able to navigate my single posts and add categories. I am using WP Core taxonomies for my Portfolio items because I need to use the same categories for my blog items. Is there a way I can change /category to /portfolio?
I hope I made myself clear, I find it quite hard to explain this.
Thank you!
EvaNovember 9, 2021 at 3:31 pm #1997913YingStaffCustomer SupportHi Eva,
Is there a way I can change /category to /portfolio?
I’m not sure I fully understand your question. Can you explain a bit more with some more related links ?
Let me know 🙂
November 10, 2021 at 5:49 am #1998454EvaHi Ying,
Thank you for getting back to me. I will try to explain again, as I said… kind of hard 🙂
Anyhow, I am using the same categories for my portfolio items as for my blog posts. The result is that the links to portfolio items in the same categories don’t work, because they go to /categories/item instead of portfolio/item. Do I need to make custom categories for my CPT or can this be resolved in an easier way?
I hope my question is more clear now.
Thank you!
EvaNovember 10, 2021 at 8:15 am #1998846DavidStaffCustomer SupportHi there,
you would need a custom archive template for your CPT.
Similar request raised here that should give some pointers:November 11, 2021 at 7:19 am #2000049EvaHi David,
Thank you! I made the custom templates as described here https://generatepress.com/forums/topic/block-element-content-template-for-custom-post-type/#post-1807598, and that works. The only thing is that I can’t manage to display an Archive page using the Block Element Content Template. I just can’t find the right settings…
Moreover, should I use a child theme now because I have added the custom templates?Thank you again!
EvaNovember 11, 2021 at 7:32 am #2000079DavidStaffCustomer SupportCustom Templates and any functions you create need to go in your Child Theme folder. Or they will be lost when the theme gets an update.
https://docs.generatepress.com/article/using-child-theme/
For your template, just make a copy of the themes archive.php and rename it accordingly:
https://github.com/tomusborne/generatepress/blob/master/archive.php
Then in your Block Element you need to set the Display Rule Location to the ‘cpt slug’ Archive
November 11, 2021 at 11:48 am #2000699EvaThanks again, David.
I have installed the Child theme and moved the archive.php there. So, that’s all set.
But… I can’t get the block element working…
Can you help me with it?I appreciate it.
Thank youNovember 11, 2021 at 8:19 pm #2000927ElvinStaffCustomer SupportHi Eva,
But… I can’t get the block element working…
Can you help me with it?Were you able to set the Display Rule Location? That part is crucial. It tells the Block element where to apply.
You’ll have to set the custom post type’s archive page as the block element’s display rule location. 🙂
November 12, 2021 at 5:52 am #2001328EvaHi!
Unfortunately, it doesn’t work. I can’t find what’s wrong. I have created a temporary account and hope you can take a look.Thank you!
EvaNovember 12, 2021 at 7:56 am #2001749DavidStaffCustomer SupportI checked
/portfolio
url to view the archive. And i can see the Content Template being applied. What am i missing?November 14, 2021 at 10:28 am #2004133EvaHi David,
I don’t know. That’s what I don’t understand… What to do now?!
November 14, 2021 at 1:28 pm #2004229YingStaffCustomer SupportHi Eva,
I checked the element – content template (portfolio item) that assigned to portfolio > all portfolio, the design more like for portfolio archives but not single portfolio, am I right?
But seems you haven’t activated the archive for portfolio, so there’s such option
portfolio archives
in the location dropdown list.You’ll need to activate the portfolio archive first in the CPT UI plugin:
https://www.screencast.com/t/1GMOvSrwThen change the location of the element to the archive of portfolio not the single portfolio.
Let me know if you need further assistance 🙂
November 15, 2021 at 5:23 am #2004705EvaHi Ying,
Actually the design is meant for single portfolio items, like (see link below). It works for the blog items (see link below also).
I activated the portfolio archive anyhow, but I don’t see any difference.I am sorry for this, hope it can be resolved.
Thank you!November 15, 2021 at 6:06 am #2004743DavidStaffCustomer SupportIf its for the Single Portfolio item then the Display Rule Location needs to be:
Portfolio
November 15, 2021 at 7:42 am #2004839EvaThat’s what I did, but no luck 🙁
The settings: http://prntscr.com/1zogh17
Any other suggestion?Thank you!
-
AuthorPosts
- You must be logged in to reply to this topic.