• vjsharan

    (@vjsharan)


    MY Child career-portfolio theme is not working…kindly help me.

    functions.php

    <?php
    /**
     * career-portfolio child functions
     *
     */
    
    /**
    add_action( 'wp_enqueue_scripts', 'career-portfolio_enqueue_styles' );
    function career-portfolio_enqueue_styles() {
        $parenthandle = 'parent-style'; // This is 'career-portfolio' for the career-portfolio.
        $theme = wp_get_theme();
        wp_enqueue_style( $parenthandle, get_template_directory_uri() . '/style.css', 
            array(),  // if the parent theme code has a dependency, copy it to here
            $theme->parent()->get('Version')
        );
        wp_enqueue_style( 'child-style', get_stylesheet_uri(),
            array( $parenthandle ),
            $theme->get('Version') // this only works if you have Version in the style header
        );
    }
    add_action('admin_enqueue_scripts', 'my_enqueue');
    
    /* ADD YOUR CUSTOM FUNCTIONS BELOW */
    
    style.css
    
    /*
    Theme Name: Career Portfolio Child
    Theme URI: https://theme404.com/downloads/career-portfolio
    Author: Saravanan
    Author URI: http://theme404.com
    Template: career-portfolio
    Version: 1.0
    License: GNU General Public License v2 or later
    License URI: http://www.gnu.org/licenses/gpl-2.0.html
    Tags: light, dark, two-columns, right-sidebar, responsive-layout, accessibility-ready
    Text Domain: career-portfolio
    */

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Joy

    (@joyously)

    You aren’t saying what the problem is…
    This line is incorrect though:
    $parenthandle = ‘parent-style’; // This is ‘career-portfolio’ for the career-portfolio.

    It should be
    $parenthandle = ‘career-portfolio’;
    and that’s only if the parent theme uses ‘career-portfolio’ in the wp_enqueue_style function. It might use ‘career-portfolio-style’ or something else. You have to read the code.

    Also, function names cannot have a dash, since it would be interpreted as subtraction. You have it twice:

    add_action( ‘wp_enqueue_scripts’, ‘career-portfolio_enqueue_styles’ );
    function career-portfolio_enqueue_styles() {

    The child theme should not use the same prefix as the parent theme.

    What is this for?
    add_action(‘admin_enqueue_scripts’, ‘my_enqueue’);

Viewing 1 replies (of 1 total)

The topic ‘child Theme website stylesheet is not loading.’ is closed to new replies.