0

Is it possible to call a template file, say for example mycustomtemplate.php inside the default Wordpress WYSIWYG editor?

I had this content.

My team (This is my content inside the WYSIWYG) then I would like to call a template file. When your inside a template file you would write

    <?php get_template_part('includes/page-team-list'); ?> 

So how could I do this on the WYSIWYG editor? Or I have to use some PHP plugins for these php codes to work on WYSIWYG?

1

1 Answer 1

0

PHP (unlike HTML) is not meant to be used as content markup language. It is server–side language with too much access. It is very challenging to safely and securely treat PHP as part of content.

For basic example — what if one of your authors writes PHP code in a post which amounts to "make me site's administrator"?

While WP plugins implementing this do exist, this is almost never good idea, especially at multi–author site.

The typical way of handling more elaborate content in WordPress is via custom fields / meta boxes (/frameworks for both), although it usually falls farther away from WYSIWYG.

1
  • I have resolve my problem, I made a separate template then use custom fields to call the template file page-team-list.
    – mejiwara
    Commented Jul 24, 2014 at 11:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.