• Hi,
    I looked for the whole forum but didn’t find any previous posts so I’m asking the question to my problem here.

    Here is what I am trying to achieve.
    In all my posts and pages, I have to insert a text at the end, the version number and every time we update the site, we have to change the version number and its a pain to go through hundreds of posts/pages.

    So I thought I create the simple html file which I want to call from my posts and pages to insert the content on every page. So when the version number change, all I have to do it edit the html file and all pages will be updated. Instead of going through on every page. For version.html file example,
    <strong>Created by "Prof. Name", Version 2.2</strong>

    I put that file in root directory of the domain as its not that important and easily accessible.

    So my questions is, how to achieve that? I read somewhere that to use the SSI method but found out, there are some restriction with PHP. Then one said I could use the following code but I’m keep getting PHP error.

    <?php virtual ('http://domainname.com/version.html'); ?>
    [insert_php]
    <?php virtual ('http://domainname.com/version.html'); ?>
    [/insert_php]

    Can you help me in this please. Or guide me to correct method to do.

    Thanks in advance.
    Theticus

    https://wordpress.org/plugins/insert-php/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter theticus

    (@theticus)

    Should be like this for version.html file content.

    <strong>Created by "Prof. Name", Version 2.2</strong>

    Hi theticus,

    This Insert PHP support forum shouldn’t be used for PHP coding questions. PHP coding forums would be more appropriate.

    Try this:

    readfile($_SERVER["DOCUMENT_ROOT"]."/version.html");

    If your PHP installation allows URLs in the readfile() function, this should also work:

    readfile("http://domainname.com/version.html");

    Will
    P.S. Wonderful resources:
    http://php.net/manual/
    http://php.net/search.php

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘call simple html file from within post or page’ is closed to new replies.