This is searchable archive of our old support forums, which operated from 2012 - 2016. To find out how to get support for your current theme, please visit our support page.

Pulling a Custom Post Type with a custom category

  • Creator
    Topic
  • #23183
    Matthew MacMillan
    Participant

    Hi all, I need the collect brain to help me unravel a riddle.

    So I have a custom post type, and it has custom categories. The tricky part is that I’m trying to get the Full Page Slider in the template to grab those posts. It’s not. I don’t know why. Here are the details:

    Custom post type and category wrought via functions.php: http://pastie.org/10414700

    Then I create an Event, and give it a category of (slug) “kcrg”

    Then I made a made a page with a custom template and added a full width post slider, with a custom query: category=kcrg

    Not working. Also tried post_type=event. That too does not work.

    I’m missing something. Anybody see what? Is there something I need to do to make JS recognize my CPT?

    Thank you for your brains and help,
    Matt

Viewing 3 replies - 1 through 3 (of 3 total)
  • Author
    Replies
  • #23184
    Matthew MacMillan
    Participant

    I’ve got it pulling post_type=events. I had to make a new post, it wasn’t seeing the ones made before I made the slider, which is odd. But now it sees all of the Events posts.

    However, I cannot get it to pull by the category. I have two categories for Events: KCRG and KPMG. The following custom queries still do not work:
    post_type=events&category_name=kpmg
    category_name=kpmg
    category_name=kcrg

    Not sure if I’m missing something in my category registration. Do I need to do something else to get the slider to see those category names?

    #23185
    Jason Bobich
    Keymaster

    Hi,

    I don’t think any of this has to do with JS specifically, as you’re just feeding your own custom query through.

    Is there a reason you’re trying to use “categories” as your taxonomy? You should register a unique taxonomy for your post type like “event_category”.

    Then your query will be post_type=events&event_category=foo

    #23187
    Matthew MacMillan
    Participant

    You are, of course, correct. Sorry about that, missed that part and thought I was missing something in how to interact with JS.

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.