Adding 'target=blank' to homepage and navigation links?

Home Forums Photo World/Photo Session Support Adding 'target=blank' to homepage and navigation links?

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #3348
    Don WallerDon Waller
    Member
    • Topics: 12
    • Replies: 15
    • Total: 27
    Member since: October 14, 2014

    Is it possible to make the links in the Photo World navigation and front page slider open in new windows?

    The new site I’m working on uses the slider (and a link in the navigation) to link to various events on different sites, and I’d like to be able to generate a new browser tab if I could. Thanks in advance.

    <b>On Edit:</b> I was able tofix the navigation link via WordPress’ Advanced Menu options. If there’s a way to do that to the home page links, it would be perfect.

    Don

    #3367
    Sonnal S SinhaSonnal S Sinha
    Keymaster
    • Topics: 10
    • Replies: 6964
    • Total: 6974
    Member since: June 12, 2013

    Hi,

    Check functions.php line number 320 to 322.

    Replace with the following code and save: if( $imgUrl != ” ){

    echo ‘{image : \”.$imgUrl.’\’, title : \”.( ($imgTitle!=”) ? ‘<div class=”slide-title”><span>’ : ” ).( ($imgHref!=” && $imgTitle!=”) ? ‘<a href=”‘.$imgHref.'” target=”_blank”>’ : ”).$imgTitle.( ($imgHref!=” && $imgTitle!=”) ? ‘</a>’ : ”).( ($imgTitle!=”) ? ‘</span></div>’ : ” ).( ($imgDesc!=”) ? ‘<div class=”slide-description”><span>’.esc_html($imgDesc).'</span></div>’ : ” ).( ($imgHref != ”) ? ‘<div class=”slide-description”><span><a href=”‘.$imgHref.'” target=”_blank”>Read More &rsaquo;</a></span></div>’ : ”).’\’, thumb : \”.$imgUrl.’\’, url : \’\’}’.( ($i==15) ? “” : “,”).”\n”;

    }

     

    #3375
    Don WallerDon Waller
    Member
    • Topics: 12
    • Replies: 15
    • Total: 27
    Member since: October 14, 2014

    Okay, I tried that and got this error:

    Parse error: syntax error, unexpected ‘{‘ in /home/twisted/www/www/wp-content/themes/skt-photo-world-pro/functions.php on line 320

    I reloaded functions.php from my local ‘clean’ copy and the error went away.

    Here is code from line 320 to 322:

    <?php

    if ( (of_get_option('innerpageslider', true) != 'hide') || is_home() || is_front_page() ) {

    for ($i=1;$i<16;$i++) {

    Am I misplacing the new code? Should the <?php stay?

    Thanks.

    #3386
    Sonnal S SinhaSonnal S Sinha
    Keymaster
    • Topics: 10
    • Replies: 6964
    • Total: 6974
    Member since: June 12, 2013

    Hi,

    That is totally wrong. On my Mac it appears Line number: 181.

    Starting line search this: if( $imgUrl !=

    This instance is only 1. Then replace this code: if( $imgUrl != ” ){

    echo ‘{image : \”.$imgUrl.’\’, title : \'<div class=”slide-title”><span>’.( ($imgHref!=” && $imgTitle!=”) ? ‘<a href=”‘.$imgHref.'”>’ : ”).$imgTitle.( ($imgHref!=” && $imgTitle!=”) ? ‘</a>’ : ”).'</span></div><div class=”slide-description”><span>’.$imgDesc.'</span></div>’.( ($imgHref != ”) ? ‘<div class=”slide-description”><span><a href=”‘.$imgHref.'”>Read More &rsaquo;</a></span></div>’ : ”).’\’, thumb : \”.$imgUrl.’\’, url : \’\’},’.”\n”;

    With the top code as given above.

    Regards,

    Shri

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.