How do I edit the code of a WordPress site?

36,776

Solution 1

The easiest way is indeed to have an FTP access and edit the blog's theme directly (in /wp-content/themes/nameofyourtheme. Otherwise, you can also do it from the Admin panel. Go to Appearance, then click on "Editor". You'll then be able to edit all the theme's files.

Edit:

If you want to change the layout of the posts, the file you'll want to edit is single.php.

Solution 2

Unless there is a plugin for this. Which there might even be. But, since i have no idea and fast googling said nothing.

You will have to edit the theme files /wp-content/themes/Your-Theme/

You will have to take something like <?php comments_template(); ?> from single.php file and move it to index.php file somewhere after where you should find something like this <?php the_content(''); ?>

  • single.php Holds the article page.
  • index.php Holds the "home" page.

Is this hosted in wordpress.com?


In the control panel you can find Appearance > editor in there you can edit the files. Thought i think that it is very likely that you wont be able to save your edits due to file permissions.


Also if its a paid hosting they quite often send you these details on email.. I mean Ftp acc and pass.

Share:
36,776
Eric Thoma
Author by

Eric Thoma

I am a PhD candidate at NYU CIMS.

Updated on April 06, 2020

Comments

  • Eric Thoma
    Eric Thoma about 4 years

    I am helping out a family member with their WordPress blog and he/she wanted to have the comments show on the main front page. This way, users don't have to click through the title to add a comment. If that is impossible, he/she wanted to have instructions like "click here to add a comment" near the title.

    I know how to write html/css etc., so I would just go in and type in some code but I don't have an FTP account. Is there a way to edit the html of a WordPress site through the WordPress Dashboard menu thing? I would ask for a FTP account, but I doubt he/she knows how to create one. Also, would doing this really screw things up for WordPress? Any and all help is appreciated. If needed I can give the URL, but I would rather not have people trying to post comments and mess around with the site. Thanks!

  • Eric Thoma
    Eric Thoma over 12 years
    I find that the problem is not that I want to edit the CSS files, but actually change the way posts are formatted.
  • laurent
    laurent over 12 years
    The Admin's editor let you change everything, including the post's PHP code.
  • Peter Ajtai
    Peter Ajtai over 12 years
    @Eric - Note: in Yoko the file is probably content-single.php, additionally, if the front page is showing other post types besides posts, you will probably have to edit the content files of those post types too (if they allow comments). - If you get stuck, try codex.wordpress.org
  • ScottyG
    ScottyG over 9 years
    If you are going to edit a theme directly WordPress actually suggests you create a child theme of your selected theme. This is to avoid having your changes over written if the theme is updated. Check out the folllow link for more information. codex.wordpress.org/Child_Themes