php - Implementing songs playlist into wordpress -


this question more oriented towards implementing actual feature wordpress rather music playlist, secondary issue

for type of functionality, create separate database table eg. wp_songs , put related columns song title, length, author, reference .mp3 file, etc.

now, see logical solution create separate class methods read songs, write new songs, delete songs. this:

class music {     public function add_new_song() { }    public function get_song_info() { }     public function delete_song() { }  } 

this add song function like:

public function add_new_song($song_name) {    global $wpdb;   $query = "insert wp_songs values ...";   $wpdb->query($query); } 

and on.

than include file needed , run them data. right thing do?

i have read plugin codes , dropping functions globally. if has suggestion of way implement it's highly appreciated

in wordpress, "post". solution more of php solution, implementing in wordpress incidental - using other php-based cms.

without understanding you're trying do, "wordpress way" create custom post type called "songs". then, add/edit/delete songs via dashboard same posts , pages.

the song title post title, , create custom fields songs - artist, length, album etc.

those 2 links should give need code yourself. if don't want code manually, types , views plugins make easy create custom post types , custom fields, , display them.


Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -