WordPress.org

Ready to get started?Download WordPress

Forums

Press, News, Events
[resolved] Special template files help (5 posts)

  1. edgedesign
    Member
    Posted 1 year ago #

    The plug-in works well, but I cannot figure out how to change the header title or get rid of the sidebar that displays regular blog posts.

    http://www.omnidirect.tv/press-releases/

    Linked directions:

    "In the form of the archive-type-template. In the same way that posts are shown on their own archive with archive.php, custom post types will use archive-{posttype}.php if it's available."

    I have created a template named: archive-press-releases.php with custom header and no sidebar, but plug-in still uses default template.

    http://wordpress.org/extend/plugins/press-news-events/

  2. mattdeclaire
    Member
    Plugin Author

    Posted 1 year ago #

    The name of your template needs to match the post type slug, which in this case is singular. So, your file should be named archive-press-releases.php.

    The three post type slugs for this plugin are: press-release, news, event.

    In retrospect, the news slug is confusing. It doesn't make sense to use just new, but I could have used news-item to make is singular. But, I don't want to change it now, as it would wreak havoc on users' existing content. I'd have to come up with a migration strategy.

  3. edgedesign
    Member
    Posted 1 year ago #

    Thanks for getting back to me!

    File should be named archive-press-release.php (singular).

    Works great now.

  4. mattdeclaire
    Member
    Plugin Author

    Posted 1 year ago #

    Ha. I specifically said it was supposed to be singular, but then I went ahead and gave you a plural url anyway. Glad you caught my error.

  5. edgedesign
    Member
    Posted 1 year ago #

    Yes... also revised single-press-releases.php to single-press-release.php. I thought it would be that simple, but didn't dawn on me to make the names singular.

    Perhaps you should include info on template file names under Custom Post Type Archives in the plug-in settings if/when you update the plug-in again. Since the names next to the checkboxes are all plural, I figured the files names should be plural when I moved onto the special template file link you have.

    I really appreciate your help and will recommend your plug-in to others.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic