• Hello,

    I have a simple website based on WordPress.

    My theme is based on a style.css, a header.php, a footer.php and an index.php page.

    Everything works fine. Now, I need to add a forum within my website (https://maidenheadvc.com/blog/).

    In order to include a forum, I need to create a new page.

    I want the page to use my index.php page ; but to include the code in a particular place …

    How should I proceed?

    Thanks

Viewing 3 replies - 1 through 3 (of 3 total)
  • Something like:

    <?php if( is_page ( 'Forum') ) :?>
    [forum specific code]
    <?php endif;?>

    should work

    https://codex.www.ads-software.com/Conditional_Tags

    [EDITED]

    Thread Starter salmoliv

    (@salmoliv)

    Thanks Esmi,

    First, for those who want to do the same, there is an error in the code. The endif should be <?php endif; ?>

    Then, unfortunately, this doesn’t work as I wish.
    The code seems to be inserted in my ‘News’ page, where I’m displaying the posts. The forum displays, but the post are removed.

    I think I might just give up and create a link to a forum, without trying to integrates it into my website !

    Thanks anyway

    Sorry about the code error. I’ve edited the original to fix it.

    The forum displays, but the post are removed.

    Sounds like you’re adding this conditional code in the wrong place in the template. If you want the posts displayed, add it after the Loop.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘index.php and page’ is closed to new replies.