Support » Fixing WordPress » How to edit html in wordpress?

  • Resolved mrling


    My site:
    Theme: WordPress Twenty-Twelve Child

    I want to have a nice gallery on my site (click on the gallery link) and am using the NextGen plugin to manage it. However, currently I don’t want to keep the white background behind it or the title “Gallery” and perhaps want to change some of the other styling. This is just a quick example that somewhat resembles what I’m going for:

    Using firebug, I can change the styles by editing .site-content, but this also changes styles on the “About” page that I want to keep.
    I figure adding an attribute such as,”div id=background-color about” is the way to go, but am uncertain of where to add this html…perhaps the “content-page.php” file by editing a copy in my child theme? Any other recommendations or tutorials I should check out?

    Thank you for your time!

Viewing 4 replies - 1 through 4 (of 4 total)
  • That would be CSS, not HTML, that needs to be modified…You can find it at Appearance>Editor, your themes default stylsheet is the first displayed…

    Note: While editing the file this way can be done, you should use an FTP tool such as FileZilla or your host provided File Manager to backup all site files prior to editing any files in that manner…Also consider using a Child Theme as any direct edits to your theme will be lost on theme update.

    She has a child theme. But no, you don’t need to change the HTML – you just need to learn a bit about how CSS works — this is a good reference site:

    You can use a page specific selector to isolate the CSS to a specific page. Look in the body tag for the page and you’ll see a page-id-number usually.

    So for your about page, use:

    .page-id-219 .site-content {

    @Seacost and WPyogi, thank you both for taking the time for your input, I was able to resolve this problem with this code:

    .page-id-251 .site-content article {
    	background-color: transparent;

    Sorry if I did not make it clear enough that I was already familiar with using a child theme and FTP. Also, I am already fairly familiar with the codex, w3schools and css, but do have to reference these sources every once in awhile still. The suggestion to look at the page id located in the body was particularly helpful. I was originally thinking I might have to go into the html to create a more specific id for styling individual pages, but it appears this is not necessary since an id already exists.
    thank you thank you thank you!

    Yep, it’s added by the body_class function:

    Most useful. Sorry if we under-assumed your knowledge :).

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘How to edit html in wordpress?’ is closed to new replies.