WordPress.org

Ready to get started?Download WordPress

Forums

San Francisco
[resolved] can't add child theme (15 posts)

  1. Dr. Ashok Koparday
    Member
    Posted 1 year ago #

    Hi,

    Thanks for the wonderful San Francisco theme.

    It appears silly, but I am not able to add child theme to San Francisco theme.
    I use the `
    @import url("../san-francisco/style.css");`

    I can load other theme child templates.
    Just puzzled.
    Kindly tell me what mistake I am making so that I can use child theme.

    Best wishes,
    Dr. Ashok Koparday

  2. WPyogi
    Volunteer Moderator
    Posted 1 year ago #

    What is in the style.css in your child theme? (Only the headers section including the @import line)

  3. Dr. Ashok Koparday
    Member
    Posted 1 year ago #

    Hi.
    Yes. As described in the codex on Child Theme there is Theme name, Author, description, etc followed by the @import mentioned above.

    I tried adding and removing functions.php. I had no issues getting child theme with Twentytwelve and other themes.

    I'm looking for slim fast loading mobile accessible theme.

    Thanks in advance.
    Dr. Ashok Koparday

  4. WPyogi
    Volunteer Moderator
    Posted 1 year ago #

    I meant post the actual code here - so some can look at it - in case there is an obvious problem with it. But there are many other themes that fit that description - so perhaps looking for another one would be easier - twentytwelve, suffusion, responsive, weaver - just to name a few.

  5. Dr. Ashok Koparday
    Member
    Posted 1 year ago #

    WPyogi,

    Here it is:

    /*
    Theme Name: San Francisco Child
    Author: Ashok Koparday Parent theme: Nu Studio
    Author URI: http://mydoctortells.com/about-doctor/ Parent Author URI: http://www.nustudio.com.au
    Description: Child of San Franciso Theme. A free SEO and Mobile Optimised WordPress Theme. This theme automatically resizes and realigns itself to fit to any screen width. Beautiful when viewing on a mobile device (iPod, iPad, Android etc) with a smaller screen or on a large desktop screen.
    Version: 1.0.0
    License: GNU General Public License
    License URI: license.txt
    Tags: custom-menu, sticky-post, microformats, rtl-language-support, translation-ready, post-formats
    San Francisco Theme, Copyright 2012, Nu Studio
    */

    @import url("../san-francisco/style.css");

    I have tried twentytwelve, responsive, weaver, thematic and measured each one with GTmetrix. San Francisco is little better than the rest.
    SemPress does not display well on mobile handsets Symbian s6 browser and UC browser.

    I appreciate your guidance.

    Best wishes,

    Ashok

  6. WPyogi
    Volunteer Moderator
    Posted 1 year ago #

    You must have this line in the above:

    template: san-francisco

    From the Codex:

    heme Name. (required) Child theme name.
    Theme URI. (optional) Child theme webpage.
    Description. (optional) What this theme is. E.g.: My first child theme. Hurrah!
    Author. (optional) Author name.
    Author URI. (optional) Author webpage.
    Template. (required) directory name of parent theme, case-sensitive.
    
        NOTE. You have to switch to a different theme and back to the child theme when you modify this line.
    
    Version. (optional) Child theme version. E.g.: 0.1, 1.0, etc.
  7. Dr. Ashok Koparday
    Member
    Posted 1 year ago #

    Thankyou WPyogi.

    • Kindly tell me if this is correct for functions.php:

      <?php

      function childtheme_create_stylesheet() {
      $templatedir = get_bloginfo('template_directory');
      $stylesheetdir = get_bloginfo('stylesheet_directory');
      ?>
      <link rel="stylesheet" type="text/css" href="<?php echo $templatedir ?>/san-francisco/style.css" />

      <?php
      }
      add_filter('san-francisco_create_stylesheet', 'childtheme_create_stylesheet');

      ?>

    • Can I use this <link rel - - ->in functions.php instead of @import in style.css?
    • Kindly guide me where I can learn php for beginners, especially related to WordPress.

    Many thanks,

    Ashok Koparday

  8. WPyogi
    Volunteer Moderator
    Posted 1 year ago #

    Why not use the standard child theme set up?

  9. WPyogi
    Volunteer Moderator
    Posted 1 year ago #

    If you just want to be able to modify CSS in a theme, use a Custom CSS plugin such as Jetpack.

  10. Dr. Ashok Koparday
    Member
    Posted 1 year ago #

    Hi WPyogi,

    Jetpack I would have liked because I love Matt Mullenweg.
    However, I found it is detrimental to Page Speed and YSlow. There are query strings too. You cannot choose and select few options. Some features come with the package.

    I didn't understand the standard child theme bit.

    Good news, and thanks to you, with twentytwelvechild I have Page Speed Grade A 98 % and YSlow Grade A 94%.
    Incredible.

    You have been great help.
    What about the PHP tutorials? w3schools and php.net weren't useful and WordPress centric.

    Thanks
    Ashok

  11. WPyogi
    Volunteer Moderator
    Posted 1 year ago #

    See the Codex for WP-centric info: https://codex.wordpress.org/Theme_Development

    My point was that your child theme for san-francisco is not set up correctly - it's missing a required line in the style.css file header. So why not fix that and use the child theme if that's what you want. Or are you going with twentytwelve?

  12. Dr. Ashok Koparday
    Member
    Posted 1 year ago #

    Going with twentytwelvechild theme obviously. I have been measuring speed of about ten themes over the last 24 hours.

    Did you know my site was hacked five days ago?
    I wish to know if I can retrieve just the January posts and drafts from backups and database. Oh! I think I should be asking that in another category of forum support.

    You have been prompt and wonderful help, appearing at the right time of my learning curve.

    Many thanks.

    Ashok Koparday

  13. WPyogi
    Volunteer Moderator
    Posted 1 year ago #

  14. Dr. Ashok Koparday
    Member
    Posted 1 year ago #

    Hmm, that sounds right, but the speed has been varying from theme to theme.

    I have gone through the above links. (I had no choice.)
    After completely deleting my site I restored from December 2012 backup. I wish to retrieve the January 2013 posts at the risk of letting the hacker's malicious code sneak in.

    I will post it later in 'how-to and troubleshooting' forum if I don't get the method on searching.

    https://codex.wordpress.org/Theme_Development
    This will be useful for me.

    Have a blessed life. Tons of thanks.

    Ashok Koparday

  15. Dr. Ashok Koparday
    Member
    Posted 1 year ago #

    Hi WPyogi,

    You are right

    "but the speed will depend much more on your content and plugins and server, than the theme itself. "

    The speeds I checked have been more or less the same.
    Themes, which include images are slower, I think.

    Thank you again,

    Ashok Koparday

Topic Closed

This topic has been closed to new replies.

About this Theme

About this Topic