Add editor toolbar to Metabox

I need to add a custom toolbar (cf. image below) to this Metaboxes Do you want to add a custom TinyMCE toolbar to the TinyMCE/visual editor, or do you want to turn a textarea into a TinyMCE editor? If it is the latter one, here’s a sample code for turning the champ_home textarea into a … Read more

edit_page or edit-pages for current_user_can()?

You can find list of capabilities here: Roles and Capabilities There is no capability called edit_post nor edit_page. But… There is also something called Meta Capabilities. The capabilities listed on the Capabilities list are global capabilities. So they’re saying that user can edit posts or pages. But it doesn’t mean that given user can edit … Read more

Show metabox only for homepage

is_front_page() is only for use on the front-end to tell if the ‘main query’ is for the front page. In a back end context you need to check if the current post ID (which is in the $post passed to your callback function) is the same ID that’s set to be the front page. So … Read more

How to add custom post widgets as tags into wordpress

Please check ACF https://www.advancedcustomfields.com/ Create new text field for title https://www.advancedcustomfields.com/resources/text/ Create new file or text field for file https://www.advancedcustomfields.com/resources/file/ You can also check link field https://www.advancedcustomfields.com/resources/link/ Adding fields to Posts When you add new field group you can set position to ‘Side’.