New Landing How can we help? Cardinal How to change text of 'Related Projects' in Portfolio

Viewing 6 posts - 1 through 6 (of 6 total)
  • Posted in: Cardinal
  • #140946
    conorlumsden
    Member
    Post count: 37

    Hi there,

    Just wondering how to change the text in the portfolio where it says “Related Projects”? I opened up the ‘single-portfolio.php’ file to see if I could change it there, but I can’t see anything.

    All the best,

    Conor

    #140963
    Kyle – SUPPORT
    Moderator
    Post count: 35880

    Hi

    Please see: http://www.swiftideas.com/forums/topic/change-the-words-related-projects/

    I know it’s for Joyn but the same applies to Cardinal

    – Kyle

    #145370
    lbdesign
    Member
    Post count: 136

    Is there a way to apply this change if using the child theme, so it will survive through updates? I altered this php file and put it in a clone of the enclosing folders in the child folder, but it had no effect.

    #145376
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    Please insert this code at functions.php of child theme.

    <?php add_filter('sf_related_projects_heading','sf_text_strings'); 
    function sf_text_strings( $translated_text ) {
    
    $translated_text = _e( "YOU TEXT", "swiftframework" );
    
    return $translated_text;
    }
    
    ?>

    Thanks
    Mohammad

    Thanks
    Mohammad

    #145385
    lbdesign
    Member
    Post count: 136

    Thank you. Now I’m getting two sets of heading text: “Related Projects + new text” on the title line.

    Did you give me a fix for a solution that involves .po files?

    The thread I was commenting on said to do this:

    Go to joyn/swift-framework/content/sf-portfolio-detail.php and edit line 264:

    <h2 class=”<?php echo $heading_class; ?>”><?php apply_filters(‘sf_related_projects_heading’, _e( “Related Projects”, “swiftframework” )); ?></h2>

    – Kyle

    #145534
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    Please remove last one code and use this one new code:-

    function sf_text_strings( $translated_text, $text, $domain ) {
    switch ( $translated_text ) {
    case 'Related Projects' :
    $translated_text = __( 'YOUR TEXT', 'woocommerce' );
    break;
    }
    return $translated_text;
    }
    add_filter( 'gettext', 'sf_text_strings', 20, 3 );

    Thanks
    Mohammad

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in and have valid license to reply to this topic.

License required for one of the following items
Login and Registration Log in · Register