Add a new link into my footer?

  • SocialChic

    #7466

    Hi all,

    I replaced the “powered by wordpress yada yada yada” w/ different text in my footer using this code from this forum (thanks @Syahir):

    function graphene_filter_gettext( $translated, $original, $domain ) {
    $strings = array(
    'Powered by %1$s and the %2$s.' => 'Website Design | Pointe Ultimate Publishing LLC',
    );
    if ( ! empty( $strings[$original] ) ) {
    $translations = &get_translations_for_domain( $domain );
    $translated = $translations->translate( $strings[$original] );
    }
    return $translated;
    }
    add_filter( 'gettext', 'graphene_filter_gettext', 10, 3 );

    but now I need to add a link to that new text, and have no idea how! I know how to do the html a href= command, but where to put it?

    I am using a child theme. Already got the “white screen of death” once, experimenting, so I’d like to ask a pro to help.

    Any chance?

    Thanks !

    Prasanna SP

    #36854
    'Powered by %1$s and the %2$s.' => '<a href="http://web-design.url">Website Design</a> | <a href="http://PUPLLC.url">Pointe Ultimate Publishing LLC</a>'

    SocialChic

    #36855

    Thanks Prasanna for such a quick and simple reply. It works perfectly!

    Details ! Details ! Seems my mistake was not putting the 'a href="http:// blah blah url"> inside the single quotes that encompassed the link text. Putting this outside the single quotes is what caused the white screen response.

    I also added: target="blank" to make the link open in another tab.

    So for the benefit of anyone else with this problem, here’s the final code I inserted in my site:

    function graphene_filter_gettext( $translated, $original, $domain ) {
    $strings = array(
    'Powered by %1$s and the %2$s.' => '<a href="http://pointeultimatepublishing.com" target="blank">Website Design</a> | <a href="http://pointeultimatepublishing.com" target="blank">Pointe Ultimate Publishing LLC</a>',
    );
    if ( ! empty( $strings[$original] ) ) {
    $translations = &get_translations_for_domain( $domain );
    $translated = $translations->translate( $strings[$original] );
    }
    return $translated;
    }
    add_filter( 'gettext', 'graphene_filter_gettext', 10, 3 );

    Works like a charm! Thanks again, @prasanna!

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

You must be logged in to reply to this topic.