• Resolved cosmocanuck

    (@cosmocanuck)


    Hi. I’m trying to show a sidebar list of a certain category of posts within a custom post type. An example URL that points to such a category is:

    https://mysite.com/project_category/video/

    However, when I use this code:

    [display-posts taxonomy=”project_category” tax_term=”video”]

    Nothing displays. (And yes there is a “video” category. I’ve tried “Video” as well though I didn’t think capitalization mattered…)

    The “project” category is created within the Divi Builder, of which I’m using a child theme – but I did locate the code where the Projects CPT is created, and the line where it’s registered looks like this:

    register_taxonomy( 'project_category', array( 'project' ), $project_category_args );

    So why does my shortcode not work?

    (I have been able to successfully use a Display Posts shortcode elsewhere on my site to show a different custom post type, LearnDash online courses – after locating their fairly obscure CPT taxonomy name online. So I figure it must be something simple I’m getting wrong here… but what?)

    Hope someone can point me in the right direction. Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Bill Erickson

    (@billerickson)

    I think the issue is that you need to add post_type="video" to the shortcode.

    The default post type is “post” so the shortcode you wrote is asking for posts with that taxonomy term rather than videos.

    Thread Starter cosmocanuck

    (@cosmocanuck)

    Thanks Bill! That did the trick. Somehow I’d assumed that if I specified the CPT’s category taxonomy, that was all I needed… anyway, thanks again!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Can’t display Project CPT category’ is closed to new replies.