I want to use the following code in my wordpress. How can I do that?
<?php
$theme_name = get_template();
$directory = "wp-content/themes/" . $theme_name . "/pdf/ECE340/";
$pdfs= glob($directory . "*.pdf");
foreach($pdfs as $pdf)
{
$link= substr($pdf,48,90);
?>
<a href="<?php echo $pdf; ?> "><?php echo $link; ?></a>
<?php
echo "\n\n";
echo "<br />";
}
?>