What is proper way to use the php if statement? [closed]

I assume you are trying to create a new template file linked to a WordPress page.

Additionnal documentation : https://codex.wordpress.org/Theme_Development#Basic_Templates

To make so, you would need to do something like this :

<?php
/*
Template Name: My first template file
*/

get_header(); 

?>

    <!-- Main body -->

    <?php
    if (1<2) {
        echo "Add multiple lines of text here and watch the scrollbars grow."
    } 
    ?>

    <!-- End Main body -->

<?php 
get_sidebar();
get_footer(); 
?>

And in you WordPress dashboard, you only have to select your template file in the Page Attributes section.


EDIT : More information about creating a new Template File.

You can save your new file as my_first_template_file.php and you will need to upload it in your theme folder.

Normally, in your FTP it will looks like public_html/wp-content/themes/my_theme_name/.

When you will have placed the file. Just refresh your page in the WordPress Dashboard. You should see the template part.

enter image description here