Inicio Forum Theme Orbit Installation and Configuration Add target="_blank" to Social links

Viendo 4 publicaciones - del 1 al 4 (de un total de 4)
  • Autor
  • #594


    Buenos Dias:

    When the user clicks the Social Icon, I would like it to open in a new window. Where is the code for these links so I can add the target attribute?

    Gracias, Ned


    Pedro Pinto
    Jefe de claves


    You must use filter action orbit_render_social_items

    In function.php child theme or function.php theme file or function.php plugin file. Put this code:

    function add_blank_targe_social_icon( $output ) {
    	$output = str_replace( 'href', 'target="_blank" href', $output );
    	return $output;
    add_filter( 'orbit_render_social_items', 'add_blank_targe_social_icon' ); 


    Hola Pedro:

    Thank you for your response.

    I added your function in my Child theme to one that was already there. However, I received an error message:

    Parse error: syntax error, unexpected ‘return’ (T_RETURN) in C:\xampp\htdocs\curly2013_wp\wp-content\themes\orbit-child-01\functions.php on line 9

    Line 9 is the return $output; reference

    Any ideas how to fix this?

    Thanks, Ned



    Problem resolved.

    I had received an email response copy from the forum, and the email had converted the quotes to HTML. THAT’s what I copied into the functions page. The online Forum reply had regular quotes, and it is working fine.

    Thanks, Ned

Viendo 4 publicaciones - del 1 al 4 (de un total de 4)

Debes estar registrado para responder a este debate.