How do you get line numbers to show up when you access php

How do you get line numbers to show up when you access php scripts in Wordpress? One of the WPMU staff told me to insert code at a specific line number, but I don't know how to produce line numbers.

  • Ash

    Hello @Randall Packer

    Welcome to WPMU community!

    I hope you are well today and thanks for asking the question.

    DO NOT attempt to edit code from wordpress editor. Because, if you don't know what you are doing and make any changes and if that breaks the site, you can't roll back to previous stage.

    So, the better option is, download that file via ftp, keep a backup (copy the file and paste it somewhere else) and then edit the file and upload. So, if something goes wrong, you can upload your backed up file :slight_smile:

    When you will download the file via ftp in your local machine, open the file using any editor or IDE like Notepad++, DreamWeaver, NetBeans, Komodo, Sublime etc. All are free editors. When you will open the file in the editor, you will see the line number in the left side like the attachments.

    Please let me know if you find this is helpful, or if you have any further questions.

    Cheers
    Ash

  • Randall Packer

    Hi Ash, Thanks for your response. This was concerning the edit of the Global Site Tags plugin you suggested a few weeks ago. Let me see if I understand:

    -- you download the php file via ftp
    -- you edit a copy of the php file
    -- and then you upload the new file that has been edited, preserving the copy?

    Is that how this works? I was making the previous edit from the Wordpress interface but I guess that's not how it is supposed to work.

    Thanks, Randall

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.