[Resolved] Basic Steps to add a Custom Post Type Module with Dispatch

Home Forums Support [Resolved] Basic Steps to add a Custom Post Type Module with Dispatch

Home Forums Support Basic Steps to add a Custom Post Type Module with Dispatch

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #888994
    Dee

    I need help with a rough outline for setting up a couple of custom post types with the Dispatch Site as a base, so I can retain the overall styling for each of the custom post type modules.

    I am using Pods to add the custom post type and taxonomy. I find there are several different places to make changes, and I feel I am chasing my tail a bit. I can figure this out if I have a to-do list to follow.

    Here is an outline of one of the custom post types to show what I am trying to achieve:

    Custom Post Type: Events

    Separate Event Landing Page for Events
    No sidebar, just columns
    Separate Taxonomy – Event_filter
    Navigation/ability to use filters to display event posts similar to the Blog Page secondary navigation in Dispatch

    Archive pages for Event_filters similar to the Dispatch category archive pages, but with events and event_filters.

    Single Posts
    Keep the Single Post Header Styling and Custom Post Navigation for the Event type posts

    Show related posts(based on event_filter) in sidebar or below content

    I have created a custom post type: event, and a custom taxonomy: event_filter and related the 2 in Pods.

    What modifications do I need to get this working?
    Modify the Additional CSS?
    Add new php page templates – or is this something I can do with elements and layout?
    How can I get the event_filters to function with the event type posts similar to the Dispatch categories/secondary navigation/archive pages?

    Thanks in advance

    #889182
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    I’m not sure I fully understand quite yet.

    The lists that come with Dispatch can be edited to show posts from different post types/taxonomies inside the WP Show Post settings.

    The “filter” (secondary navigation) can be changed conditionally using a plugin like this: https://wordpress.org/plugins/conditional-menus/

    The standard archives in WordPress can’t be made to look like Dispatch without some significant coding, unfortunately. It’s something we’d like to get integrated into the Blog module at some point.

    If there’s a specific issue I’m missing here, it may be better to tackle the issues one by one.

    Let me know ๐Ÿ™‚

    #889212
    Dee

    I think I am overthinking this:

    OK, Lets start with the event archive page here: https://dzp.photo/event/
    Single Event page https://dzp.photo/event/the-third-of-the-tests/

    1. I can create the WPSP list to for event-sidebar and have the original Sidebar list, but both show. What is the best method to conditionally show the correct list? Can I use 2 hooks for before_right_sidebar_content for each post type(Events and Posts?) When I do this, where do I apply the css class for the list (wpsp-card zero-padding no-background)?

    2. I want the custom post navigation like the standard posts, but relating to events only. Do I need to create another hook element just for events, and then what do I change in the element coding?

    I will add my other questions as separate posts.

    #889725
    Tom
    Lead Developer
    Lead Developer

    1. You could try a plugin like this: https://wordpress.org/plugins/content-aware-sidebars/

    It should allow you to conditionally display widgets depending on the page you’re viewing.

    2. Can you show me a page with the custom post navigation? I think it should stay within its current post type (events) by default, but I could be wrong.

    #889735
    Dee

    Yes I just added the Custom Sidebars plugin for the sidebars. I was hoping to minimize my plugins, but this works.

    2. Here is an example. The custom post navigation does not show at all.

    #889740
    Tom
    Lead Developer
    Lead Developer

    Can you make sure the “Custom Post Navigation” element (Appearance > Elements) is set to display in events inside of its Display Rules?

    #889742
    Dee

    Yes, I checked it, and it is set to posts and events

    #889749
    Tom
    Lead Developer
    Lead Developer

    Can you try replacing the custom post navigation code with this?: https://gist.github.com/generatepress/179434f97888af190ee1d65e36402962

    #889754
    Dee

    Awesome….that works

    #889757
    Tom
    Lead Developer
    Lead Developer

    Awesome! ๐Ÿ™‚

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