Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8884061
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T20:58:23+00:00 2026-06-14T20:58:23+00:00

I have the following php code inside the part of my website. It’s a

  • 0

I have the following php code inside the part of my website.

It’s a very simple code which adds the meta name robots, wmt tool verification meta and the rss meta.

It works OK but for one thing:

When I look in the source of my page with IE or Fireforx, I don’t see new lines between the meta’s. They are displayed one after another on a single line.

How do I add new lines? any ideas? Would there be any issue if I let them like this?

Here is the code:

if((is_home() && $currentpage == 1) || (is_single() && $title != 'Online' && $title != 'Cam') || (is_category() && $robots == 'y')){
        echo '<meta name="robots" content="index,follow"/>';   
    } else {
        echo '<meta name="robots" content="noindex,follow"/>';
    } 
    if(get_option('enable_wmt') == 'y'){
        echo '<meta name="google-site-verification" content="'.get_option('wmt').'"/>';
    }
    if (is_home() && $currentpage == 1){
        echo '<link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="'.$site_current.'/feed/"/>';
    }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T20:58:25+00:00Added an answer on June 14, 2026 at 8:58 pm

    Well, actually the cause is simply that you do not specify any linebreaks. You have to output linebreaks as well if you want them to be generated, just like with every other conent.

    I usually use this syntax, since it does not make the code unreadable:

    if((is_home() && $currentpage == 1) || (is_single() && $title != 'Online' && $title != 'Cam') || (is_category() && $robots == 'y')){
            echo '<meta name="robots" content="index,follow"/>'."\n";   
        } else {
            echo '<meta name="robots" content="noindex,follow"/>'."\n";
        } 
        if(get_option('enable_wmt') == 'y'){
            echo '<meta name="google-site-verification" content="'.get_option('wmt').'"/>'."\n";
        }
        if (is_home() && $currentpage == 1){
            echo '<link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="'.$site_current.'/feed/"/>'."\n";
        }
    

    Explanation: the sequence \n is the description of a single linebreak character. The character cannot be entered directly outof two reasons:

    1. it is a whitespace, so very hard to handle for editors and

    2. the ‘normal’ linebreak has special meaning in language syntax.

    When using that linebreak character inside php you must enclose it in double quotes ("). Only when contained in double quotes such special characters are interpreted by php. If you use single quotes (') those sequences remain uninterpreted. That is a difference that comes in handy now and then… In this case it helps us to stick with the simple and easy to read way of how you hand over the strings to be output to the echo command. We use the colon (.) to concatenate two strings and use double quotes to have the special character sequence interpreted.

    Another note for the sake of completeness: there are different way of how linebreaks are specified under different circumstances. Most notably this is handled different und different operating systems. The classical unix systems (thus also Linux) use the character cited above (\n, how 0x10 in hex notation), MS-Windows uses two characters to specify a single linebreak: \n\r (hex 0x10 0x13, or linebreak and carriage return). Older MacOS systems used something different again, though the current MacOSX systems are also unix based. Since the internet is traditionally unix land (has been developed and enhanced under unix like systems) the unix like behaviour is found and expected in many parts of internet technologies.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following PHP code doing a very simple select into a table.
I have php code which executes a loop, inside which it generates the following:
I have the following php code which I want to add a delay too:
I have the following PHP code which works out the possible combinations from a
I have the following code inside the body of my index.php page: echo Begin
I have the following simple mysqli php application, which should work fine. $pk is
I have tried as following code in wordpress inside single.php file <?php echo $counter
I have the following HTML code inside a div: <a href=http://www.mysql.com> <img src=images/php-power-micro2.png alt=Image
In a Symfony project, I have the following php code inside a YML file.
currently I have the following code inside my 'function.php' is function calcTime($database_name,$currentTime){ global $startTime;

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.