• New to CPs, although reading a lot about them I’m struggling to understand them.

    For a radio project, I need to use CPs to create and display pages for show-hosts (similar to DJs).

    From what I’ve grasped so far, I think I need to create a CP with a type of ‘host’ – which’ll then add an item to the admin menu from which I can then create a page for each host.

    I’m not yet sure what else I need to do to be able to display an archive-type page which lists all hosts.

    Also, I’m confused about the url structure…

    Currently, my blog posts structure is domain/notes/, so I need to have ‘with front’ set appropriately so as to not prepend CPs with ‘notes’.

    That seems straightforward, and will I think publish them as domain/custom-post-name/.

    But I’m wondering if that url can be rewritten/modified, or if there’s another option, so that they can better-fit within the existing structure of my site.

    Created using normal pages, I have domain/programs/ within which is domain/programs/hosts/.

    Although domain/programs/hosts/ could likely be replaced by a ‘hosts’ archive-type page, I’d rather keep it as-is and have the individual and archive-type pages for hosts below that – perhaps domain/programs/hosts/az/ (so as to display an a-z listing of hosts), with links to the individual pages which’ll be domain/programs/hosts/host-name/.

    It seems logical, but I’ve no idea just how to do this.

Viewing 2 replies - 1 through 2 (of 2 total)
  • When you are registering the custom post type, you need to set the flag for has_archive to `true, and this will auto-magically create the archive page for that post type.

    With the URL, the standard way that i twill work (using your case) is that the URL’s will be structured like this:

    Archive page – /hosts/
    Profile page – /hosts/dj-name/

    There are ways to do it differently, but they are pretty advanced, and I haven’t had much luck in making them work before. 🙂

    Thread Starter gulliver

    (@gulliver)

    Ok, thanks.
    That helps me to better understand.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Custom posts – struggling to understand.’ is closed to new replies.