Posts Tagged ‘ plugin

Executing WordPress shortcodes

By default, WordPress shortcodes can only be used in pages, posts and widgets.
If you want to include a shortcode for a cool plugin, or a special functionality you need, in your WordPress Template for example, you can use the following code to make it happen.

<?php echo do_shortcode('[shortcode goes here]'); ?>

Google Syntax Highligher

I found a new plugin today for WordPress; “Google Syntax Highlighter”.
It formats your source code pastings on the fly.

Here’s a test below:

<?php

$fp = fopen("$datafile","a"); // Open datafile

if(!$fp) {
 echo "Error: Cannot open file.";
 exit;
}

fwrite($fp, $fname."|$|".$lname."|$|".$org."|$|".$country."|$|".$date."|$|".$ipadd."|$|".$usagent."\r\n");
fclose($fp);

header("Location: http://" . $_SERVER['SERVER_NAME'] . "/offshore/db/thanks.php"); /* Redirect browser */
exit;
?>