• Great plugin – would you be able to add a basic shortcode in the staff-directory loop that allows us to pull out either the full link to that staff members page, or their id so that we can link it manually?

    i added/changed the following in classes/staff_director_shortcode.php in the plugin director and it fixes my requirement, but may be a nice simple addition to future releases. changes done around lines 290

    $staff_id = get_the_ID();
    $accepted_single_tags = array("[name]", "[photo_url]", "[bio]", "[category]", "[staff_id]");
    $replace_single_values = array($staff_name, $photo_url, $staff_bio, $staff_category, $staff_id);
    
    $accepted_formatted_tags = array("[name_header]", "[photo]", "[email_link]", "[bio_paragraph]", "[website_link]", "[staff_id]");
    $replace_formatted_values = array("<h3>$staff_name</h3>", $photo_tag, $staff_email_link, "<p>$staff_bio</p>", $staff_website_link, $staff_id);

    https://www.ads-software.com/plugins/staff-directory/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author adamtootle

    (@adamtootle)

    Adding a staff member link is something on my to-do list, but I don’t have any official plans for it yet. Someone else has requested support for this as well as a single staff member template. I’m going to try to hack something together in the coming days, but I’ve got a little more research to do before I can promise anything.

    Adding to this thread.

    I had a specific need for slugs. And I hope I am using “slugs” the right way–I am somewhat new to WordPress.

    I needed “john-smith” from this plug-in. So, I used

    $staff_slug = basename(get_permalink());

    insert this right under $staff_name (it really does not matter but for easy to find purpose).

    And then, followed “accepted_single_tags” and “replace_single_values” so that I can use this as [name_slug].

    I can then use john-smith from Staff title, and also use it as anchor.

    a href=”my_url/#[name_slug]”>[name]</a

    and so on…and so on…

    I suppose I am okay how it functions until adamtootle introduces on the future release, like [permalink] and [name_slug].

    PS the original need for slugs was to use them as anchor. This attempt was to satisfy my frustration on a website that someone else designed, and the current owner wanted that way ??

    Also would like to know if this might happen. From all the various plugins I have tried this one is the most basic yet near perfect I imagined such a plugin should be. Thanks Adam, great job!

    I would also like the profile link to be “web_url”/category/name.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Addition to basic shortcodes’ is closed to new replies.