• I use WP as a backend publishing tool for a site built using a series of php templates. I use the following code to call posts and/or categories and include them in the templates:

    <?php
    ini_set (user_agent, "blah");ini_set (default_socket_timeout, "5");
    error_reporting(0);
    $theurl="https://www.theurl.com/blog/2007/11/02/the-post-or-category-slug/";
    $filestring=file_get_contents("$theurl");
    echo "$filestring";
    ?>

    This works fine, but in cases where some templates have multiple instances of these calls I’ve noticed it creates a pretty (very) heavy load on Apache. Can anyone advise a way to do this that’s less CPU intensive?

    Can’t use simple

    <?php include(="https://www.theurl.com/blog/2007/11/02/the-post-or-category-slug/"); ?>

    as security-wise my host says no go.

    BTW, WP sits in a folder in the route directory (as above) called blog. I guess I could call the posts/categories directly from the DB but not sure how to do this…any suggestions?

    Many thanks,

    – Rob

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘WP CMS Hack question’ is closed to new replies.