Site icon Hip-Hop Website Design and Development

Methods to show content material If perform exist/situation true?

I’ve created my {custom} posts. Information from the identical is displayed in as an instance single-custom-post.php.

Now to wash that file and to take away 100 strains of code, I need to make a brand new file (let’s name it custom-header.php) after which simply echo or name that content material.

Since I’ve constructed {custom} submit as a plugin, ideally could be good to name it if plugin is lively, nevertheless I do not know end this as a result of one assertion is that if myplugin is lively however then I might someway add one other assertion – perform, and right here I’m misplaced (under).

I may name it by if perform exist, however then i’m not certain how do I create that perform.

What I did and it does work is that this:

after which in single-custom-post.php I changed that 100 strains of code with

embrace (TEMPLATEPATH . '/inc/custom-header.php' );?>

So my downside is, I do not know is that this a great way, and if it is not, what’s it?