If your custom code should output something where normally you have post content, use a shortcode.
Convert your code in a plugin, this can be done simply adding plugins header, even only
<?php
/**
* Plugin Name: My Plugin
*/
on top of your php file. More info here.
After that use the add_shortcode
function to output your content. See docs.
Remember that the function that handle the shortcode must return the output, and not echo it.
After that, an advice regarding style and script. In WordPress, right way to add styles and scripts to frontend are the functions wp_enqueue_script
and wp_enqueue_style
both called inside a function that hooks into wp_enqueue_scripts
.
If you do this, probably you want to know a way to enqueue scripts/and styles only in posts that contain the shortcode, for that look at has_shortcode
function.
Finally, to use both wp_enqueue_*
functions, and to insert the image you said you have, you need to know the url of your plugin folder.
Please do not hardcode it, but use plugins_url
function to correctly retrieve it.
Without seeing your code, there are no much more things I can say, try to implement what I said and if you have problems try to ask a more specific question.