user3542686
user3542686

Reputation:

wordpress - how to access and edit index.php file

Is there a way to edit the index.php file in wordpress?

Around the web i found a lot of post saying to go to appearance -> editor,

but I can't find this menu... maybe this feature was removed...

So how can I do it?

Upvotes: 1

Views: 40014

Answers (2)

Matt Wilson
Matt Wilson

Reputation: 187

There are two ways you can edit your PHP files.

Method 1: Edit the file in your Installation Directory on the Web Server (this is what Anoop Asok is talking about)

Go to WordPress Installation directory. Follow the path wp-content > themes. Open your theme folder. In that you can see index.php file. Edit it and save.

Method 2: Edit the file from the WP Dashboard (This is easier and is what you were trying to do but that file isn't always made available by your theme)

  • Download, install, and activate the Synchi plugin (this is an awesome IDE and one of its nice features is that it will allow you advanced theme editing)
  • Go to Appearance > Editor . Now you will see the -themes- window on the right and you will have full access to all your theme files.
  • Double-click your theme and drill down until you find your file you want to edit

NOTE! You should avoid editing your theme files because they might be over-written next time you update your theme. Make a child theme and put a copy of index.php in there and work off that one instead.

Upvotes: 2

Anoop Asok
Anoop Asok

Reputation: 1337

Please do this.

Go to WordPress Installation directory. Follow the path wp-content > themes. Open your theme folder. In that you can see index.php file. Edit it and save.

Upvotes: 1

Related Questions