I’m doing up a photography theme in WP at the moment, and I’ve already got great help on this thread (thanks Milo!) for a previous question.
In that thread, I asked about displaying the file name of an uploaded file on the
attachment.php page for that file. I’m now using the suggested answer, which uses this code to display the name:
<?php echo basename( wp_get_attachment_url( $post->ID ) ); ?>
What I need to do, however, is to display this file without its extension: so,
filename, instead of
filename.jpg. Is there any easy tweak to this existing PHP snippet that could do this? If not, what would be a best-practice way of achieving this end result?
I should add that I’m far from a PHP expert, so take it easy on me... :)