Simple Staff List
[resolved] Disable archive and staff member page (8 posts)

  1. Auk
    Posted 3 years ago #

    Great plugin!

    Just one problem - as it is a custom post type, it creates a page for individual staff members and an archive page, neither of which I can disable or edit.

    I've tried changing 'has_archive' => true, to 'has_archive' => false, without success. Also, this method will be over-written when the plugin is updated.

    The individual staff member pages are potentially useful if they can be made to display the same content as produced by the short code, but they only show the image and staff name. I've tried creating a content-sslp_staff_member.php but this doesn't work.

    I'd like to be able to disable the archive page completely, and, either disable the individual staff member pages or be able to customise them.

    I'd like these customisations to stick when the plugin is updated.

    Any ideas?

    Thank you.


  2. peterjonathan
    Posted 3 years ago #

    I agree, Great Plugin !

    I would like to change the template used for the individuals page.

    How can I add the [staff-bio] info to the individuals staff member page ?

    (I can't find how http://wp-site/staff-members/fred-bloggs/ translates to a php template, then how can one add the [staff-bio] info to that template)

  3. peterjonathan
    Posted 3 years ago #

    Halfway there, http://codex.wordpress.org/Post_Types details the naming convention for custom type post templates.

    The creation of the single-staff-member.php and loop-single-staff-member.php templates in the theme directory (copied from single.php and loop.php) are being used to generate the individuals staff page.

    Now how can the [staff-bio] be added ...

  4. peterjonathan
    Posted 3 years ago #

    By copying some of the code from the plugins user-view-show-staff-list.php file I managed to get the image and bio showning on each individuals page.

    The template code changes shown below worked for me:

    # diff single.php single-staff-member.php
    < get_template_part( 'loop', 'single' );
    > get_template_part( 'loop', 'single-staff-member' );
    # diff loop-single.php loop-single-staff-member.php
    >         <?php
    >           $custom = get_post_custom();
    >           $bio = $custom['_staff_member_bio'][0];
    >           $photo = '';
    >           if(has_post_thumbnail()){
    >             $photo = '<img class="staff-member-photo" style="float:right;" src="'.wp_get_attachment_url( get_post_thumbnail_id()).'" alt = "'.get_the_title().'">';
    >           }
    >         ?>
    >             <?php echo($photo); ?>
    <             <?php the_content(); ?>
    >             <?php echo($bio); ?>
  5. Auk
    Posted 3 years ago #

    Peter, you're a genius!
    Thank you.

    Now, I just need to disable the archive page that appears at http://wp-site/staff-members/ ... Any ideas on with that one?

  6. brettshumaker
    Plugin Author

    Posted 3 years ago #

    Good job, guys.

    Auk: Setting has_archive to false should be enough. May need to flush your permalink settings by saving them in the admin or try clearing your cache. When I click your link, nothing comes up for me.

  7. Auk
    Posted 3 years ago #

    Permalinks! I always forget to flush permalinks.
    Thank you, Brett.

  8. brettshumaker
    Plugin Author

    Posted 3 years ago #

    No worries.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Simple Staff List
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic


No tags yet.