How to make a shortcode with your own styles and scripts to wp?

Good day, I write a plugin, there is a need to make a shortcode that outputs a block
In Hadar porubay theme styles and scripts
And there are two problems: shortcode leaves at the top of the page (though to be inside the text) and styles. I can not understand in what a hitch...
And another question, as using a shortcode to get the id of the article?
July 9th 19 at 10:06
1 answer
July 9th 19 at 10:08
Styles it is better to connect via wp_enqueue_scripts, they have probably not connected and not working in some way (check).
The shortcode for the id of the article
is the add_shortcode('post_id', 'post_id_shortcode');
post_id_shortcode function()
{
global $post;
echo $post->id;
}

Find more questions by tags WordPress