WordPress.org

Support

Support » How-To and Troubleshooting » Why ALL My php Files have Empty Lines Inbetween ?

Why ALL My php Files have Empty Lines Inbetween ?

  • Hello,

    I just need a clarification.
    In each and every php file there is an empty line inbetween the lines.
    I dont know why. Can someone tell me why is this happening ?

    Example:

    <?php get_header(); ?>
    
            <div id="content">
    
            <?php if (have_posts()) : ?>
    
                    <?php while (have_posts()) : the_post(); ?>
    
                            <div class="post" id="post-<?php the_ID(); ?>">

    Previously when I uploaded it, It was like this:

    <?php get_header(); ?>
            <div id="content">
            <?php if (have_posts()) : ?>
                          <?php while (have_posts()) : the_post(); ?>
                            <div class="post" id="post-<?php the_ID(); ?>">
Viewing 6 replies - 1 through 6 (of 6 total)
  • esmi

    @esmi

    Forum Moderator

    And where is this happening? In Appearance -> Editor? Is your site running on a non-Windows server?

    Hello esmi,

    It’s happening all over my php files inside my wp site.
    But when I login to my dashboard -> Appearance -> Editor – It’s fine.

    If I download the file to my computer,
    all the files has a blank line inbetween the lines as above..

    It’s puzzling me..

    Sorry, I forgot to answer your question. It’s on Linux dedicated server.

    esmi

    @esmi

    Forum Moderator

    Sounds like the files were edited and saved in PC format rather than in Unix format. The end result is every line break gets doubled. If the theme files are re-saved in a plain text editor in UNIX format, the problem will disappear.

    Hmm.. I’m trying to understand what you said. Thanks esmi.
    [Note for you: Please have a hair cut]

    May be some code injected and automatically removed by a scanner.

    It may use “\r\n” for replace with blank line.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Why ALL My php Files have Empty Lines Inbetween ?’ is closed to new replies.