Forum Replies Created

Viewing 12 replies - 1 through 12 (of 12 total)
  • Thread Starter RinnieWriter

    (@rinniewriter)

    Crud – the <link> tag isn’t in there…I double-pasted that oops in the process of compiling that reply… please skip that line.

    Thread Starter RinnieWriter

    (@rinniewriter)

    The functions.php file is there because one of the modifications I have to do is changing the footer, which I was attempting to do as per these instructions. Referenced article in that link says, “Unlike style.css, the functions.php of a child theme does not override its counterpart from the parent. “

    So, the functions.php file that I have in the child theme is:

    <?php
    
    // Remove old copyright text
    add_action( 'init' , 'mh_remove_copy' , 15 );
    function mh_remove_copy() {
            remove_action( 'attitude_footer', 'attitude_footer_info', 30 );
    }
    
    // Add my own copyright text
    add_action( 'attitude_footer' , 'mh_footer_info' , 30 );
    function mh_footer_info() {
       $imgUrl = url::file_loc('img');
       $output = '<div class="copyright">Copyright ? [the-year] [site-link] Powered by: <a href="//www.company.com/website-optimization-design.html"> <img title="Website Optimization" src="'. $imgUrl . 'images/logo130.png" alt="Website Optimization" width="130"/></a></div><!-- .copyright -->';
       echo do_shortcode( $output );
    }
    <link rel="author" href="https://plus.google.com/111599818756142119126/posts" />
    
    ?>

    (I had to strip out the URL-specific stuff to keep Google from snagging this forum string, but you can inbox me for details.)

    Thread Starter RinnieWriter

    (@rinniewriter)

    (I can’t figure out how to edit my post, so I can’t just add a follow-up question or update the information.)

    Since the child theme was previously activated, and at that time the child style.css had all the lines from the parent style.css, I don’t think that I should be copying any PHP files (other than function.php) into the child theme folder. I re-read the child themes info, and it doesn’t mention anything about needing any files from the parent theme except for whatever is necessary to delineate the desired modifications. And, since the child theme was able to be activated before I stripped out all the other lines from the styles.css that are okay as-is in the parent styles.css…I’m thinking it must be something that I deleted from the styles.css that is throwing the “template missing” error.

    Since the error now is that the template is missing, does that mean the child’s style.css has to also include the lines defining the styles where the word template is part of the style/class name?

    Thread Starter RinnieWriter

    (@rinniewriter)

    I actually didn’t have a \ in the file, that was just a copy/paste from Windows Explorer within the context of describing where I had placed the child theme directory. I’m sorry if that was confusing…

    In the CSS i only have referenced exactly as:
    @import url("../attitude/style.css");

    I have the child theme’s style.css containing only the lines that have been modified, and for clarity/simplicity, the entire child style.css is:

    /*
    Theme Name: Attitude Child
    Author: FindLocal Company
    Description: Child theme for the Attitude theme
    Author: FindLocal Company
    Template: attitude
    Version: 0.1.5
    */
    
    @import url("../attitude/style.css");
    
    /* =Menu MODS------------------------------------------------- */
    
    #access {
    	/*border-top: 1px solid #EAEAEA;*/
    	/*border-bottom: 1px solid #EAEAEA;*/
    }
    
    #access ul {
    	border-radius: 10px 10px;
    	background-color: #6CD6E6;
    	margin: 5px;
    }
    
    #access a {
    	color: #333;
    	display: block;
    	font-size: 14px;
    	padding: 16px 5px 5px;
    }
    
    /* =Header MODS---------------------------------------------- */
    #branding {
    	margin-top: 60px;
    }
    .hgroup-right {
    	margin-top: -78px;
    }

    So, the child folder only contains the /images folder with only the modified images, and the function.php, and the modifications-only version of the style.css.

    Now the theme won’t activate. It shows as a broken theme, template missing.

    Thread Starter RinnieWriter

    (@rinniewriter)

    I loaded the attitude-child theme and activate it, so it shows as the theme. However, the style.css apparently isn’t reading through, because even though when I view the style.css in the editor and verify that the changes are there, none of the changes are showing. Path is ..\wp-content\themes\attitude-child\style.css and the style.css is a copy of the style.css from the parent theme with modifications. I originally modified it in the parent directory, so I know the modifications work. It just isn’t working now that I moved it to the child directory and upgraded the theme.

    Thread Starter RinnieWriter

    (@rinniewriter)

    OK, that seems to work better in that the page loads, although the banner and other stuff isn’t showing. At the bottom of the page, I see this error:
    Fatal error: Class ‘url’ not found in /home/content/../html/blog/wp-content/themes/attitude-child/functions.php on line 12

    where line 12 is now
    $imgUrl = url::file_loc('img');
    in the function.php…

    Do I need to add a div tag for url? Or is that a capitalization or delimiter issue…?

    (Yes, I’m really green. Thanks in advance for your patience.)

    Thread Starter RinnieWriter

    (@rinniewriter)

    I’m getting an unexpected T_STRING error, so I must have missed a quote or something in the function.php:

    //Unlike style.css, the functions.php of a child theme does not override the parent functions.php __ It is loaded immediately before and in addition to the parent’s functions.php.
    
    <?php
    
    // Remove old copyright text
    add_action( 'init' , 'mh_remove_copy' , 15 );
    function mh_remove_copy() {
            remove_action( 'attitude_footer', 'attitude_footer_info', 30 );
    }
    
    // Add my own copyright text
    add_action( 'attitude_footer' , 'mh_footer_info' , 30 );
    function mh_footer_info() {
       $output = '<div class="copyright">'.'Copyright ? [the-year] [site-link] Powered by: <a href="<?php echo "https://www.thatcompany.com/topicpage.html"; ?>"><img title="Client Service Group" src="<?php echo url::file_loc('img'); ?>images/logo130.png" alt="Client Service Provided" width="130"/></a></p> '.'</div><!-- .copyright -->';
       echo do_shortcode( $output );
    }

    Error statement is:
    Parse error: syntax error, unexpected T_STRING in /home/content/k/a/l/kalosplastics/html/blog/wp-content/themes/attitude-child/functions.php on line 14

    with line 14 in the above code being this argument:
    $output = '<div class="copyright">'.'Copyright ? [the-year] [site-link] Powered by: <a href="<?php echo "https://www.thatcompany.com/topicpage.html"; ?>"><img title="Client Service Group" src="<?php echo url::file_loc('img'); ?>images/logo130.png" alt="Client Service Provided" width="130"/></a></p> '.'</div><!-- .copyright -->';

    Thread Starter RinnieWriter

    (@rinniewriter)

    (Wiping egg from face) imperfect memory… found that in the string you ref’d on the previous support topic

    Thread Starter RinnieWriter

    (@rinniewriter)

    (deep breath) Feels a little like a request to go swimming led into what I thought I was jumping off the high dive but landed in the ocean.

    I’m trying to digest what all is involved in setting up a child theme. I get why it’s needed, makes perfect sense. I’m getting a little confused with the part about ‘get_stylesheet_directory()’ — specifically whether that’s applicable to just change the footer text and hrefs.

    I thought I had seen a reply in this string about a footer-somethingElse.php, which I think is where I’d edit the text/href but I’m not seeing that now….?

    Thread Starter RinnieWriter

    (@rinniewriter)

    Um, I’m sorry…I’m completely new to WordPress. Apparently I looked in the wrong place for the version. The footer of my Dashboard says “Thank you for creating with WordPress. Version 3.5.2” and there are no updates showing as available, so as far as I can tell I do have the latest versions of WP and Attitude, it’s just when I posted the first time I copied from the right column of this page thinking it was displaying my version of WP and it wasn’t. Sorry…

    Thread Starter RinnieWriter

    (@rinniewriter)

    (FYI – WordPress version: 3.5.1)

    I am having the same error. Does anyone have a solution?

Viewing 12 replies - 1 through 12 (of 12 total)