WordPress.org

Forums

Our Team by WooThemes
[resolved] "Read More" Link - Solution (7 posts)

  1. Amber
    Member
    Posted 1 year ago #

    This thread/post is not a support question. I saw this question asked in a few threads with no response so I thought I'd create this thread for anyone wondering how to achieve this.

    If you have a user with a really long biography in their team member content you don't necessarily want all that text output on the page where you're listing multiple team members (i.e via shortcode).

    Currently, if you attempt to break up a team members content using the <!--more--> tag it will be ignored when the content is displayed (i.e via shortcode); not ideal in all scenarios.

    There is a filter in the plugin, shown on line 196 of the woothemes-our-team-template.php file, that allows us to get around this called "woothemes_our_team_content".

    If you want to display only part of the team member content, using the <!--more--> tag found in the team member content editor, add the following to your functions.php:

    add_filter( 'woothemes_our_team_content', function () {
        global $more;
        $real_more = $more;
        $more      = 0;
        $output    = wpautop( get_the_content() );
        $more      = $real_more;
    
        return $output;
    } );

    If you want to change the text of the "More" link to something custom you can modify the line above from:

    $output = wpautop( get_the_content() );

    to:

    $output = wpautop( get_the_content( 'Read Full Biography...' ) );

    Hopefully this will help others who are bumping into this problem using this plugin. :)

    * Solution courtesy of Rarst on WordPress StackExchange

    http://wordpress.org/plugins/our-team-by-woothemes/

  2. Roger Soto
    Member
    Posted 1 year ago #

    for those coming from http://wordpress.org/support/plugin/testimonials-by-woothemes

    works well for me

    add_filter( 'woothemes_testimonials_content', 'xxcode');
    
    function xxcode() {
        global $more;
        $real_more = $more;
        $more      = 0;
        $output    = wpautop( get_the_content() );
        $more      = $real_more;
    
        return $output;
    }

    rogersoto.com

  3. katiemurray
    Member
    Posted 1 year ago #

    Thank you Roger Soto, for posting this. I found it helpful.

  4. katiemurray
    Member
    Posted 1 year ago #

    And Amber Member, than you too

  5. jameskoster
    Member
    Plugin Author

    Posted 1 year ago #

    FYI this will be fixed in the next release :-)

  6. Roger Soto
    Member
    Posted 1 year ago #

    Thanks for the fit back :)
    jameskoster and hopefully solve it in its next update;

    Gracias por el fit back :)
    y espero que jameskoster lo solucione en su proxima actualizacion

    [sig moderated as per the Forum Rules]

  7. Amber
    Member
    Posted 10 months ago #

    The most recent version of "Our Team" does appear to honour the "More" tag. However, there is no "Read More" link associated with it. The text appears to just cut off with [...] as the ending.

    I tried using the above posted snippet and it doesn't appear to work any longer either. :/

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Our Team by WooThemes
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic

Tags

No tags yet.