This thread is over two years old and may be outdated. Please create a new thread if you need help, or email us if you have an active Premium license.

Creating “Vantage” Child Theme with a new “functions.php” file

Resolved 6 replies premiumthemetheme-vantage
10 years ago · Last reply by Andrew Misplon 10 years ago

I’m trying to customize a couple of page templates in the Vantage Premium theme, so I’m following best practices and making those changes in a child theme. I looked up the WordPress Codex official instructions on how to create a child theme, and they explicitly state that relying entirely on a “style.css” with an “@import” command is no longer best practice.
So, following the WordPress Codex instructions, I created a “style.css” file and a “functions.php” file along with it. Here are the contents of the “functions.php” file. I believe I’ve added them correctly, following the WordPress instructions at “https://codex.wordpress.org/Child_Themes”:

URL: http://www.franlevy.com

This is our free support forum. Replies can take several days.

Need fast email support? Get SiteOrigin Premium

Replies

6
  1. joker6solitaire 10 years, 5 months ago

    Half of my question was cut off!

    Here is the code written in my “functions.php” file for the child theme:

    <?php
    	add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles' );
    	function theme_enqueue_styles() {
        wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );
    	}
    	function theme_enqueue_styles() {
        $parent_style = 'parent-style';
        wp_enqueue_style( $parent_style, get_template_directory_uri() . '/style.css' );
        wp_enqueue_style( 'child-style',
            get_stylesheet_directory_uri() . '/style.css',
            array( $parent_style )
        );
    	}
    add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles' );
  2. joker6solitaire 10 years, 5 months ago

    And the contents of my “style.css” file:

    /*
     Theme Name:   Vantage Child
     Theme URI:    http://www.franlevy.com/blog/wp-content/themes/vantage-child/
     Description:  Vantage Child Theme
     Author:       Fran Levy
     Author URI:   http://www.franlevy.com
     Template:     vantage
     Version:      1.0.0
     License:      GNU General Public License v2 or later
     License URI:  http://www.gnu.org/licenses/gpl-2.0.html
     Tags:         responsive-layout, fluid-layout, custom-background, custom-menu, featured-images, theme-options, threaded-comments, translation-ready, black, white, light, one-column, two-columns, full-width-template
     Text Domain:  vantage-child
    */
  3. joker6solitaire 10 years, 5 months ago

    (Question continued)

    When I load the child theme folder via FTP, I try to preview/activate it via the WordPress Dashboard. But I always get the following error message:

    “Internal Server Error
    The server encountered an internal error or misconfiguration and was unable to complete your request.
    Please contact the server administrator, and inform them of the time the error occurred, and anything you might have done that may have caused the error.
    More information about this error may be available in the server error log.”

    What am I missing from my child theme for a correct installation?

  4. Andrew Misplon Staff 10 years, 5 months ago

    Hi Joker6solitaire

    Thanks for reaching out :)

    If you’d like to give our Vantage starter theme a try, you can find it here:

    https://siteorigin.com/wp-content/uploads/2015/03/vantage-child-starter.zip

  5. joker6solitaire 10 years, 5 months ago

    This child theme works smoothly so far. Thank you for your help!

  6. Andrew Misplon Staff 10 years, 5 months ago

    For sure :)

Replies on this thread are closed.

Please create a new thread if you have a question, or purchase a SiteOrigin Premium license if you need one-on-one email support.

Have a different question or issue?

Start New Thread