Forums

Help with php include on Pages (5 posts)

  1. tbx_3001
    Member
    Posted 3 years ago #

    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?

  2. Michael Torbert
    WordPress Virtuoso
    Posted 3 years ago #

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

  3. tbx_3001
    Member
    Posted 3 years ago #

    What about pages? Not post.

    I tried this:

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

    But I got an error.

    Thanks

  4. whooami
    Member
    Posted 3 years ago #

    umm, whats php include doing inside php tags?

    neither of those are going to work

    <?php
    if ($page->ID != 381) {
    include("my-content.php");
    }
    ?>
  5. tbx_3001
    Member
    Posted 3 years ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Topic