Getting Plugin to read all script files

Plugins, like any other functions file in a theme are just extensions to your theme’s functions.php file. Any file that extends the main functions.php has to be manually included into the main functions file. The reason for this is, only files and templates within WordPress file structure gets auto laoded. There is no logic to … Read more

Custom Post Type Audio Content

Assuming that you have a Custom Post Type “myaudio”: Create a function to render the upload page <?php function brg_upload_audio_page(){ //display uplaod form if (empty($_POST)){ ?> <h2>Upload Audio</h2> <form action=”” method=”post” enctype=”multipart/form-data”> <p>Title of the song</p> <input type=”text” name=”post_title”> <p>File</p> <input type=”file” name=”fileToUpload” id=”fileToUpload”> <input type=”submit” value=”Upload” name=”submit”> </form> <?php } if ( ! function_exists( … Read more

How to get html tag ids from template?

WordPress doesn’t operate with DOM for the purpose of page source generation from templates. Templates are treated and run as PHP source files, producing any and all output. Unless you have control over actual templates your options likely are: Attempting to buffer and rewrite output (rather fragile, more so for publicly released plugin) Adjust markup … Read more