• Hi,

    I have edited the page.php source code by adding something like this
    <?php include(“my-content.php”); ?>
    Which the will “my-content.php” will show up on all of the pages.

    Now I would like to only disable on a page 381. What is the php code to only disable it a this page?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Michael Torbert

    (@hallsofmontezuma)

    WordPress Virtuoso

    if ($post->ID != 381) {
    php include(“my-content.php”);
    }

    Thread Starter tbx_3001

    (@tbx_3001)

    What about pages? Not post.

    I tried this:

    <?php
    if ($page->ID != 381) {
    php include(“my-content.php”);
    }
    ?>

    But I got an error.

    Thanks

    umm, whats php include doing inside php tags?

    neither of those are going to work

    <?php
    if ($page->ID != 381) {
    include("my-content.php");
    }
    ?>
    Thread Starter tbx_3001

    (@tbx_3001)

    Does anyone know the solution to this?

    I edited this file “page.php” and added the php include below.
    <?php include(“my-content.php”); ?>

    But on page id 381 I dont want it to show up.

    Thanks.

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

The topic ‘Help with php include on Pages’ is closed to new replies.