{"id":25526128,"url":"https://github.com/emmannweb/custom-post-type-and-taxonomy","last_synced_at":"2026-04-25T23:36:15.772Z","repository":{"id":122519389,"uuid":"165949928","full_name":"emmannweb/custom-post-type-and-taxonomy","owner":"emmannweb","description":"Custom post type and Taxonomy for music.","archived":false,"fork":false,"pushed_at":"2019-04-19T14:50:22.000Z","size":5,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-21T22:41:44.964Z","etag":null,"topics":["wordpress-development"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/emmannweb.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2019-01-16T01:15:11.000Z","updated_at":"2019-04-19T14:50:24.000Z","dependencies_parsed_at":null,"dependency_job_id":"17277195-c9ab-4efd-b84e-0ec4196a828c","html_url":"https://github.com/emmannweb/custom-post-type-and-taxonomy","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/emmannweb/custom-post-type-and-taxonomy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emmannweb%2Fcustom-post-type-and-taxonomy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emmannweb%2Fcustom-post-type-and-taxonomy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emmannweb%2Fcustom-post-type-and-taxonomy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emmannweb%2Fcustom-post-type-and-taxonomy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/emmannweb","download_url":"https://codeload.github.com/emmannweb/custom-post-type-and-taxonomy/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emmannweb%2Fcustom-post-type-and-taxonomy/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32280979,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-25T18:29:39.964Z","status":"ssl_error","status_checked_at":"2026-04-25T18:29:32.149Z","response_time":59,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["wordpress-development"],"created_at":"2025-02-19T21:16:39.245Z","updated_at":"2026-04-25T23:36:15.765Z","avatar_url":"https://github.com/emmannweb.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Custom post type and Taxonomy for music.\n\n### Explanation\n\nAs you may know, Wordpress let you add your own custom post type according to your need.\nIn our example, we choose Music.\nwe could choose another field like movies, meals and so on..\nnow we wanna have all musics to register in the wordpress database, it's what the custom post type has done for us.\n\nBut there's a problem, if we want to display our music by genre like jazz, classic, rap, R\u0026B and so on... now comes the necessity to have\na taxonomy. let's make it simple.. a taxonomy is just a way to group a certain type of music in our example.\n\nTo proceed we create a PHP function name \"create_music_function\" and its labels (the labels are what the user gonna see in the screen, in \n the wordpress dashboard).\nin the code where you see \"register_post_type\", we named our post type musics.\n\nwe created inside the function, the taxonomy to categorize our musics; where you see \"register_taxonomy\" and we gave it a name\n\"music_category\"\n\nwhere you see.. 'rewrite' =\u003e array('slug'=\u003e... ) is what you gonna see in both case in the url .\n\nFinally, we used a hook \"init\" to initialize our custom post type.\n\n### Display your custom post type in the frond-end\n\nyou will need to query where you want to show your custom post type like so:\n\n       \u003c?php \n       \n       // create an instance of WP_Query.\n         $mycustomPostype = new WP_Query(array(\n          'post-type'=\u003e 'musics',\n          'posts_per_page'=\u003e3\n         ));\n         \n         // basic usage\n          if (have_posts()){\n          \n             while ($mycustomPostype-\u003ehave_posts()){\n             $mycustomPostype-\u003ethe_post();\n          }\n          \n          } \n          \n          wp_reset_postdata();\n\n      ?\u003e\n      \n\n### Flexibility\n\nTo use it, you just need to copy the entire code in your wordpress functions.php file or you can use it as a plugin also.\n\n#### If do not understand totally, you may leave a question.. and make some lecture in wordpress codex\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femmannweb%2Fcustom-post-type-and-taxonomy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Femmannweb%2Fcustom-post-type-and-taxonomy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femmannweb%2Fcustom-post-type-and-taxonomy/lists"}