WordPress – How to import html code into a page?

What I would like to do is have a html form that I will place at the end of most of my pages. I am not planning to have it on every page, but most.

Edit: I realized after posting that I didn’t make it clear enough that I don’t mean in the footer, but something I would like to add on the page itself.

Read More

Of course I could simply copy in the full html and css code at the bottom of the pages I want it on. However I know there is a better and cleaner way to have my html form and css in one file and then either through making a plugin, use of short code, html code or some other option I’m not aware of, import the html code into the page.

So what would be a good approach to accomplish this?

Thanks for any help.

Related posts

2 comments

  1. Custom Fields could help? this is the fastest way i could think of. Alternatively you could use shortcodes
    edit page.php file and add the following in the loop:

    <?php if(get_post_meta(get_the_id(),"add_custom_form", TRUE)){ ?>
        <p>some custom html here</p>
    <?php } ?>
    

    Then go to the pages you want to add the form to, and add a custom field “add_custom_form” with any value.

Comments are closed.