WordPress.org

Ready to get started?Download WordPress

Forums

Editing mutliple features of a theme (7 posts)

  1. claireford
    Member
    Posted 1 year ago #

    I am trying to edit multiple features of a child theme. I have been using the preview of my webpage to determine the changes I want to make and editing the code in responsive design mode. I then copy the changes into the theme's stylesheet. I have found that the first change I entered was successful but subsequent changes haven't been, and then the final one in a sequence of four was successful. I'm not sure whether I'm trying to edit features that can't be changed or if I've just missed something obvious in the coding. Also, is there an easier way to apply changes than what I am currently doing?

    I'm using a child theme based on 'Mantra' and the code I've entered is as follows:

    [ Moderator note: please wrap code in backticks or use the code button. ]

    /*
    Theme Name: Chris's Theme
    Description: Child theme for Mantra Theme
    Author: Chris Huston
    Template: mantra
    */
    
    @import url("../mantra/style.css");
    
    #access {
        display: block;
        float: left;
        margin: 0px auto 0px;
    }
    #front-text2 h1 {
        font-size: 28px;
        line-height: 28px;
        margin-top: 0px;
        margin-bottom: 0px;
    }
    #frontpage blockquote {
        width: 88%;
        max-width: 88% !important;
        margin-bottom: 20px;
        font-size: 10px;
        line-height: 22px;
        color: rgb(68, 68, 68);
    }
    blockquote {
        border: 1px solid rgb(238, 238, 238);
        padding: 5px;
        display: block;
        background-color: rgb(250, 250, 250);
        font-style: italic;
        max-width: 90% !important;
        margin: 0px auto;
        clear: both;
        float: none;
        color: rgb(153, 153, 153);
        border-radius: 5px 5px 5px 5px;
        box-shadow: 0px 0px 3px rgb(255, 255, 255) inset;
    }
  2. alchymyth
    Forum Moderator
    Posted 1 year ago #

    try to clear the browser cahce to get to see the changes immediately - press 'reload' or press 'CTRL F5' or ...

    what changes do you expect?
    can you post a live link to the site where the problem can be seen?

  3. claireford
    Member
    Posted 1 year ago #

    For this code the first change is to the spacing - I've changed the margin to 0px and this change saves ok. The second is also a change to a margin for a text block and the third is a change to the font size. The final code is changing the border of a text block - I've changed the padding to 5px and this change saves.

    When I make the changes the site looks correct but as soon as I navigate away and come back into it only the first and last change are applied.

    Unfortunately the site is under development and password protected so I can't provide a link.

    Any suggestions?

  4. claireford
    Member
    Posted 1 year ago #

    OK, so I figured that the changes that are not successful are predetermined in the parent theme so I have created a functions.php in the child theme and entered the following code:

    if ( ! function_exists( 'mantra_frontpage_generator' ) ) {
    function mantra_frontpage_generator() {
    // Front page generator
    }
    }
    #front-text2 h1{
    font-size:28px;
    line-height:28px;
    margin-top:0px;
    margin-bottom:25px;
    }

    #frontpage blockquote {
    width:88% ;
    max-width:88% !important;
    margin-bottom:20px;
    font-size:16px;
    line-height:22px;
    color:#444;
    }
    I am now getting the following error message when I go to the website:

    if ( ! function_exists( 'mantra_frontpage_generator' ) ) { function mantra_frontpage_generator() { // Front page generator } } #front-text2 h1{ font-size:28px; line-height:28px; margin-top:0px; margin-bottom:25px; } #frontpage blockquote { width:88% ; max-width:88% !important; margin-bottom:20px; font-size:16px; line-height:22px; color:#444; }
    Warning: Cannot modify header information - headers already sent by (output started at /home/ozflie5/public_html/wp-content/themes/childmantra/functions.php:21) in /home/ozflie5/public_html/wp-includes/pluggable.php on line 876

    HELP!!

  5. WPyogi
    Volunteer Moderator
    Posted 1 year ago #

    If you can't login to your site, you'll need to use FTP (or other file manager) to access your site files and delete that file - you can find it here:

    wp-content
        themes
            mantra child theme
               functions.php - delete or rename this file
  6. claireford
    Member
    Posted 1 year ago #

    I've removed the code from the function.php file so I can log in to my site but I still need to figure out how to make the desired changes.

  7. WPyogi
    Volunteer Moderator
    Posted 1 year ago #

    Unfortunately, it's next to impossible to help with CSS questions without seeing the site live. Are you using a browser tool like Firebug to look at the CSS and why it's not working? Might be that your CSS selectors are incorrect or not specific enough. Have you checked to make sure your CSS is valid?

    http://jigsaw.w3.org/css-validator/

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags