Viewing 4 replies - 16 through 19 (of 19 total)
  • lxg

    (@mastermind)

    I just c&p’ed it in an own php and exececuted it on my machine. It gives me the following (PHP 5.1.1):
    Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /var/www/localhost/htdocs/test.php on line 68

    lxg

    (@mastermind)

    By the way, I see you are trying to mark the current item via a regex action. You might want to try this plugin which automatically outputs a pages list and marks the current item with an own class “current_page_item”.

    Thread Starter elyonline

    (@elyonline)

    Thanks Mastermind,

    Hmmm, still unsure what is going on here.

    I don’t get that error.

    ardamis

    (@ardamis)

    Try:

    <?php
    require('./wp-config.php');
    $wp->init();
    $wp->parse_request();
    $wp->query_posts();
    $wp->register_globals();
    ?>

    This seems to throw the desired HTTP Status Code: HTTP/1.1 200 OK while allowing the non-WordPress page to use WP tags and themes.

    A more complete description of the method: https://www.ardamis.com/2006/07/10/wordpress-googlebot-404-error/

    Good luck.

Viewing 4 replies - 16 through 19 (of 19 total)
  • The topic ‘What wp header code do I use in non-wp pages?’ is closed to new replies.