Forums

How to open a Quick Launch Link in a New Window...? (4 posts)

  1. sheiksoft
    Member
    Posted 5 months ago #

    I am using Inanis Glass Theme and it works good. I want to know how to open a Quick Launch link in a new window. When I click now its opening in the same window. In HTML I can simply do this:
    <a href="..." target="_BLANK">...</a>

    But in PHP and specifically from his Code I dont know how to figure it out... This is the following code which I found in Useroptions.php

    /* QUICKLAUNCH BAR OPTIONS */
    
    // The QuickLaunch bar is the area of buttons between the Options Orb and the
    // Page/Category buttons on the Task Bar. To see a demo, just change
    // $QuickLaunch below to 1, save/upload this file and refresh your blog page.
    // $QuickLaunch determines if the QuickLaunch area is shown.
    // $qla[x] and $qlt[x] array entries determine what to show in each QuickLaunch
    // button. MAKE SURE YOU HAVE THE SAME NUMBER OF $qla THAT YOU HAVE OF $qlt
    // AND VICE VERSA. MAKE SURE THAT YOUR LISTS OF $qla AND $qlt GO IN NUMERICAL
    // ORDER. FAILURE TO OBSERVE THESE RULES WILL RESULT IN BREAKAGE.
    // 0 = Don't Display QuickLaunch.
    // 1 = Display QuickLaunch
    // Anything else defaults to Don't Display QuickLaunch
      $QuickLaunch = 1;
    
      // URLs for QuickLaunch Buttons
      $qla[0] = 'http://www.inanis.net/';
      $qla[1] = 'http://www.wordpress.org/';
    $qla[2] = 'http://www.pcsafety.us/';
    
      // Text for QuickLaunch Buttons (should be no more than 2 characters)
      // You can also place an image of no more than 19px wide by 22px high, that is
      // if you know how. You can use the examples below for help.
      $qlt[0] = '<img src="'.get_bloginfo('template_directory').'/images/void-button.png" alt=" " title="Visit Inanis.net" />';
      $qlt[1] = '<span title="Visit WordPress.org">WP</span>';
    $qlt[2] = '<span title="Visit PCSafety.us">PCS</span>';

    Please Help me with this..Hope somebody will hear my sound in Wordpress Forums.

  2. sheiksoft
    Member
    Posted 5 months ago #

    Bump...Anybody Help me please...

  3. chschenk
    Member
    Posted 5 months ago #

    Open the file functions.php of that theme, search for the function insert_quicklaunch and have a look at the line after the foreach. It echos the a element and you can add the target="_BLANK" there. Does that work?

  4. harimulyanto
    Member
    Posted 2 months ago #

    Yes, it is work.. change function.php line 282 :

    echo '<li><a href="'.$qla[$key].'" target="_blank">'.$qlt[$key].'</a></li>';

Reply

You must log in to post.

About this Topic