[Resolved] Navigate single posts using WP Core taxonomies for CPT

Home Forums Support [Resolved] Navigate single posts using WP Core taxonomies for CPT

Home Forums Support Navigate single posts using WP Core taxonomies for CPT

Viewing 15 posts - 1 through 15 (of 18 total)
  • Author
    Posts
  • #1997883
    Eva

    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!
    Eva

    #1997913
    Ying
    Staff
    Customer Support

    Hi 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 🙂

    #1998454
    Eva

    Hi 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!
    Eva

    #1998846
    David
    Staff
    Customer Support

    Hi there,

    you would need a custom archive template for your CPT.
    Similar request raised here that should give some pointers:

    https://generatepress.com/forums/topic/block-element-content-template-for-custom-post-type/#post-1807598

    #2000049
    Eva

    Hi 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!
    Eva

    #2000079
    David
    Staff
    Customer Support

    Custom 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

    #2000699
    Eva

    Thanks 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 you

    #2000927
    Elvin
    Staff
    Customer Support

    Hi 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. 🙂

    #2001328
    Eva

    Hi!
    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!
    Eva

    #2001749
    David
    Staff
    Customer Support

    I checked /portfolio url to view the archive. And i can see the Content Template being applied. What am i missing?

    #2004133
    Eva

    Hi David,

    I don’t know. That’s what I don’t understand… What to do now?!

    #2004229
    Ying
    Staff
    Customer Support

    Hi 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/1GMOvSrw

    Then change the location of the element to the archive of portfolio not the single portfolio.

    Let me know if you need further assistance 🙂

    #2004705
    Eva

    Hi 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!

    #2004743
    David
    Staff
    Customer Support

    If its for the Single Portfolio item then the Display Rule Location needs to be: Portfolio

    #2004839
    Eva

    That’s what I did, but no luck 🙁
    The settings: http://prntscr.com/1zogh17
    Any other suggestion?

    Thank you!

Viewing 15 posts - 1 through 15 (of 18 total)
  • You must be logged in to reply to this topic.