I want to add an item to my WordPress admin menu - "News" - it's to contain a list of articles written about my company.
Each article will consist of the following metadata:
- Headline
- Date
- Link to article (always an external URL)
- Teaser text (typically 1-2 sentences from the article)
- Publication logo (ie, Forbes, The New York Times)
None of the items in News will link to an actual page on my site, but I'd like the ability to loop through and output the list metadata on any page.
My main question is: how do I add "News" to the WordPress admin menu without creating a custom post type (and preferably without relying on a plugin)?
Upon clicking "News" in the admin menu, I'd like an edit screen to load, similar to the one used for Posts, Pages, etc.
I've tried using the add_menu_page hook, like so:
function register_my_custom_menu_page(){
add_menu_page( 'News', 'News', 'add_news', 'metaboxes/events_meta.php', '', get_home_url() .'/wp-content/themes/my_theme/assets/img/logo.png', );
}
But end up with a completely blank screen containing the word date. How do I ensure I still within the context of the WP admin menu?
Once I figure out the best approach for adding News to the admin menu, my plan is to use WPAlchemy for the metaboxes. I would like to avoid using Advanced Custom Fields.
Any insights would be greatly appreciated.