onclick event within the functions.php file
-
I am building some text output for a specific page using my theme’s functions.php file – the file that everyone uses.
I have a function that echo’s out the details from a few functions to the screen, and this is one of them.
One of these functions sends the text to the calling function, I have this (shortened for easy reading);
function btm_ca_101_text_before_category_step1() { return "blah blah... <a href='http://www.blahblahblah.com/pdffile.pdf' target='_blank' onclick='_gaq.push(['_trackEvent','Download','PDF',this.href]);' >Click Here to Download the Top Ten Guide (PDF).</a> blah blah blah"; }The problem is when it’s actually echoed out into html, the web page shows;
<a _trackevent','download','pdf',this.href]);'="" onclick="_gaq.push([" target="_blank" href="http://www.blahblahblah.com/pdffile.pdf">Click Here to Download the Top Ten Guide (PDF).</a>I can’t figure out why everythign is rearranged.
The topic ‘onclick event within the functions.php file’ is closed to new replies.