Skip to:

Unload a file from bbpress or wp header

  • MayurSomani



    I am using geshi library in wordpress for syntax highlighting. This is implemented using a plugin (code colorer).

    Geshi library is also used on my bbpress forum (bbpress is not integrated with wp).

    I am using sql query to show latest bbpress posts on wp homepage. The issue is that I have to include bb-load.php to run the query, which causes the error that geshi is already included (since wp included it in header).

    How to resolve this issue?

    One option is to use wp conditionals so that geshi is not loaded when its is_home()

    Another way is to use RSS parsing instead of db query to show the forum posts on wp home.

    For some reason, I don’t want to use either of them at this time.

    So, how can I “unload” geshi.php from wp/bbp on my wp home?

    Any ideas are appreciated.

    Thanks for reading.

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

  • zaerl


    Don’t you use require_once()/include_once() in order to load the library?



    Hi, fixed the issue, edited the bbpress plugin to use this,

    if (!class_exists(‘GeSHi’)) {

    include_once(“geshi/geshi.php”); }

    Thus the class is not reused on wp.

    Thanks zaerl for the hint :)

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.
Skip to toolbar