• Resolved gringozero

    (@gringozero)


    On the page for a single staff member, I found out how to disable the breadcrumbs through CSS.

    Below that it shows the department, which is also a link.
    I want to turn that link off, but gather I need to do that in the PHP.
    I’m useless at PHP.
    What line can I change and what should I change it to.

    Also, the photos do not work as links. Is this possibly because of my theme?

    https://www.ads-software.com/plugins/staffer/

Viewing 15 replies - 1 through 15 (of 17 total)
  • Thread Starter gringozero

    (@gringozero)

    While I’m at it….
    How could I add a link to the individual staff member page to “go back” to the previous page (the one that has the gallery shortcode )

    Any luck on having this resolved? Same issues here.

    Thread Starter gringozero

    (@gringozero)

    Nope. Chalk another one up for zero support!

    Plugin Author Edward R. Jenkins

    (@cardiganmedia)

    Free support is not provided for this plugin. This is a community support forum. I’ll respond here when possible. Paid support and customization is also available.

    If a staff member has an active department term attached to his profile, the department link will display. There’s currently no way to hide this with CSS but there probably will be in the next release.

    The request to add a “go back” link is also a customization. Adding this would require making a custom template, which I’ve described here (designers and developers will find use of this):

    https://www.ads-software.com/support/topic/custom-archive-template-for-staffer?replies=1

    Thread Starter gringozero

    (@gringozero)

    I guess I should have said “chalk another one up for zero community support”. Ahem.

    I’ll take a swing at using the custom template method you linked to. Looks promising.

    thanks

    Hi Gringozero – if you’re able to get this to work, would you be willing to help a helpless guy like me? I honestly have no idea how to do this and I’d really appreciate a hand.

    If so, let me know. Thanks a bunch!
    Steve

    Thread Starter gringozero

    (@gringozero)

    Turns out my client did their own work-around, by editing the single-staff.php file. Apparently he found someone that knows more about PHP than I do (and I know very little). I wish I could share it with you, but I no longer have access to his account.

    You could add this directly under line 64 to remove the link:

    $terms = strip_tags( $terms );

    Oh and you could refer to this link so the change doesn’t get over-ridden when you update the plugin.

    https://www.edwardrjenkins.com/tutorials/sample-custom-archive-template-staffer/

    Hi Robbo870…
    Okay, so you’re saying I can copy the PHP in the link you provided there, save it as archive-staff.php, but before doing that, I need to enter:
    $terms = strip_tags( $terms );

    Right above <div class=”staff-content”>

    Is this correct?
    And in doing so, it should remove the links under the Department?

    Don’t you mean single-staff.php? Also, post code using code tags.

    Anyway, make a copy of the single-staff.php file and edit it using your favourite text editor.

    Search for the following. It should be on line 64 if you’re up to date.
    $terms = get_the_term_list ( $post->ID, 'department', '', ', ' );

    Create a new line underneath that and add
    $terms = strip_tags( $terms );

    Then save the file as “single-staff.php”. As per the documentation, drop this new file into your theme’s directory. It will over-ride the plugin’s default template.

    If everything has worked you’ll no longer have the department name hyperlinked.

    Wow, great. That was easy. Thanks so much Robbo.

    So I’ve basically replaced the single-staff.php file with this edited one – but won’t it be replaced if I update the plugin? Or no?

    Appreciate your patience and help here!

    Cheers,
    Steve

    PS – any idea how to get the profile pics to link to the bios? Or to add a “Read more” on this page? https://grassroots.church/about-us/staff/

    I imagine it’s fairly complex? If so, no worries. If it’s something easy and you’d be willing to share the process, that’d be fantastic!

    You need to make a copy of single-staff.php and upload it to your theme directory, according to the developer’s documentation. ie upload it to wp-content/themes/your-current-theme/

    Then, when you update the plugin, the plugin’s copy of the file will get over-written but your template will remain intact.

    To add a hyperlink to your image, look at load-staffer.php

    Change line 498 to

    <a href="<?php echo the_permalink() ?>"> <?php the_post_thumbnail ( 'medium', array ('class' => 'aligncenter') ); ?></a>

    However, note that this file will get overwritten when you update your plugin. It can’t exist as a custom template.

    I’m pretty sure that the “read more” functionality is controlled by the_excerpt() which is defined by your theme’s functions.php, in which case have a read here: https://codex.www.ads-software.com/Customizing_the_Read_More

    Also plenty of tutorials on that elsewhere on the web.

    Hm, I replaced
    <?php the_post_thumbnail ( 'medium', array ('class' => 'aligncenter') ); ?>

    with
    <a href="<?php echo the_permalink() ?>"> <?php the_post_thumbnail ( 'medium', array ('class' => 'aligncenter') ); ?></a>

    And it didn’t seem to work. Any suggestions on that?

    What shortcode and layout are you using?

Viewing 15 replies - 1 through 15 (of 17 total)
  • The topic ‘Disable link to Department on Single member page’ is closed to new replies.