PHP if statements newbie

Hello everyone,

I have a basic knowledge of PHP. I can get by with includes.

I am modifying a WordPress website for a client.

The client wants a video player displayed in the website, which is fine. There is an include there for the video player.

WordPress is made up of several PHP files.

In the header file: I’ve placed this code:

<?php if ( is_page(‘7’) ) { ?>

<?php include(‘videoplayer.php’); ?>

<?php } else { ?>

<?php } ?>

Which means on page 7 of the wordpress site displayed the content of the video player. In the video player.php file there is a title and breadcrumb.

In the image attached you can see I have a duplicate title and brumbcrumb, the title and breadcrumb below the video player needs to be removed. I am curious how to apply an if statment to this.

Here is the code I’ll need to change to apply the if statement.

Any help will be greatly appreictated.

<?php
// the title
if (strpos(get_the_title($post->ID), ‘//’)) {
$thisTitle = ‘<strong>’ . str_replace(‘//’, ‘</strong>  //  ‘, get_the_title($post->ID));
}else {
$thisTitle = ‘<strong>’. get_the_title($post->ID) .’</strong>’;
}
?>
<!-- Title / Page Headline –>
<div class=“full-page”>
<h1 class=“headline”><?php echo $thisTitle; ?></h1>
</div>

        &lt;div class="hr"&gt;&lt;/div&gt;

        &lt;!-- Breadcrumbs --&gt;
        &lt;div class="full-page"&gt;
           &lt;p class="breadcrumbs"&gt;
              &lt;?php show_breadcrumbs(); ?&gt;
           &lt;/p&gt;
        &lt;/div&gt;
        
        &lt;!-- End of Content --&gt;
        &lt;div class="clear"&gt;&lt;/div&gt;

What I am trying to do is to place if statement that if page is = 7 appears I’d like no post title and no breadcrumbs please.

This code just above is included in the videoplayer, you will see with the image shown.

Many many thanks

You should simply be able to use the following

$breadcrumbs = true;
if (is_page('7')){
    include('videoplayer.php');
    $breadcrumbs = false;
}

then for the second if statement try

<?php
// the title
if (strpos(get_the_title($post->ID), '//')) {
    $thisTitle = '<strong>' . str_replace('//', '</strong> &nbsp;//&nbsp; ', get_the_title($post->ID));
} else {
    $thisTitle = '<strong>'. get_the_title($post->ID) .'</strong>';
}

if ($breadcrumbs){
?>
    <!-- Title / Page Headline -->
    <div class="full-page">
    <h1 class="headline"><?php echo $thisTitle; ?></h1>
    </div>

    <div class="hr"></div>

    <!-- Breadcrumbs -->
    <div class="full-page">
    <p class="breadcrumbs">
    <?php show_breadcrumbs(); ?>
    </p>
    </div>
<?php } ?>

The first if statement will set $breadcrumbs from been true to false then the second if statement checks if $breadcrumbs is true only