Hello everyone, I am new to the forum, and sure glad a forum like this exists!

I am working through a Wordpress site, and am not very well versed (or at all) with PHP.

Overall goal: I have some icons in the header wrapper of my site that link to several 'quick tools' - which basically means, someone clicks on the icon for 'calculator' and a small popup window with a calculator opens up in front of them.

In searching through my theme I have found this PHP snippet that controls this (on my side I just fill in the blank on a form with the url).

$show = false;
if($this->_general['post_ci_linkedin_show'])
{ 
    $url = urlencode(get_permalink($post->ID));
    $title = urlencode($post->post_title);
    $source = urlencode(get_bloginfo('url'));

$surl = $this->_general['post_ci_linkedin_url'];
$surl = str_replace('[%url]', $url, $surl);
$surl = str_replace('[%title]', $title, $surl);                
$surl = str_replace('[%source]', $source, $surl);

$out .= '<a class="icon" href="'.$surl.'" rel="LinkedIn"><img class="unitPng" src="'.get_bloginfo('template_url').'/img/icons/community/comm_LinkedIn.png" /></a>'; 
$show = true;
}

Which produces a link to whatever I place on my admin side in a form (example: www.website.com/calculator). However, what I would like it to produce is something that creates a popup window as specified.

Example:

href="javascript:void window.open('http://www.websitename.com/subpage/mypage','', 'height=700,width=500');"

It will not let me just place this in the form section on the admin side.

Is there any way I can manipulate the above PHP code to help produce this ends result?
Thanks for taking the time to read this and help.

    You could try adding a class or id attribute to the anchor tag and then use javascript to attach a click event to it and handle it all from a javascript file.

      Write a Reply...