Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter TheBusinessManager

    (@thebusinessmanager)

    Just wanted to let you know that although the actual php code can’t be seen on the search page, the problem is not solved.

    I’ve been editing the code of my search.php file so that the page doesn’t display the php code anymore. Simply couldn’t leave it like that…

    Just thought I’d let you know…

    Plugin Author WillBontrager

    (@willbontrager)

    Hi Gabriel,

    Unfortunately, there’s not much I can suggest without seeing the code you’re using. But here are three:

    – Verify you’re using the “Text” tab and not the “Visual” tab when inserting or editing the PHP code.

    – Verify your PHP code doesn’t throw an error. Error logs are your friends.

    – Have a look at the Code Elements That Don’t Work section of the Insert PHP Instruction page.
    https://www.willmaster.com/software/WPplugins/insert-php-wordpress-plugin-instructions.php#nonworkingelements

    Other sections of that page might also throw light on what you’re experiencing.

    If the code you’re using with Insert PHP is confidential, you may submit it to me directly via our secure form
    https://www.willmaster.com/secure/

    Will

    Thread Starter TheBusinessManager

    (@thebusinessmanager)

    Hi Will. Your prompt reply is much appreciated.
    I am using the Text tab instead of the Visual.

    Basically the php code is most of the time a require_once to a certain file along with a variable, such as:

    [insert_php]
    $my_variable = ‘somevalue’;
    require_once(‘somedir/somephpfile.php’);
    [/insert_php]

    Again, it shows fine on every page except the search page where instead of being parsed, the actual php code is being displayed as it is in the wp backend editor.

    As mentioned before, my problem is solved for now and I can live with this solution but if you’ll manage so find an “out of the box” solution for this, I’ll be more than happy to hear it.

    Also, I will get back in case I find out something that may be helpful.

    Happy New Year to you Will!

    Gabriel

    Plugin Author WillBontrager

    (@willbontrager)

    OK, if the very same code works on other pages of the same WordPress installation, then the difference is related to the search page.

    Perhaps whatever does the searching or provides the results somehow preempts the page or otherwise prevents the Insert PHP code from running.

    The code you provided should work. With the same code on other pages where it works OK, the only reason I can think of that it might not on this page is what I mentioned, that somehow the code doesn’t reach the Insert PHP plugin or the output of the plugin is discarded.

    Will

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Search results showing php code’ is closed to new replies.