0

I am installing a new theme for my website. I am in the process of adding a child theme but it keeps going wrong for some reason. I am using wordpress. I uploaded the theme, radiate to the bluehost file manager page. then I created another folder called radiate-child. in the child theme folder is style.css and functions.php. both folders exist in the wp-content/themes folder so I know they're in the right place. At first the child theme appeared but wordpress showed no preview and activating it made every page on the site (both back end and front end) redirect to 500 error logos.

here is the functions.php code

<?php

    add_action( 'wp_enqueue_scripts', 'my_theme_enqueue_styles' );
    function my_theme_enqueue_styles() {
        wp_enqueue_style( 'radiate-style', get_template_directory_uri() . '/style.css' );

    }
    ?>
    <?php
    function my_theme_enqueue_styles() {

        $parent_style = 'radiate-style'; // This is 'radiate_style' for the Radiate theme.

        wp_enqueue_style( $parent_style, get_template_directory_uri() . '/style.css' );
        wp_enqueue_style( 'radiate-child',
            get_stylesheet_directory_uri() . '/style.css',
            array( 'radiate-child' ),
            wp_get_theme()->get('Version')
        );
    }
    add_action( 'wp_enqueue_scripts', 'my_theme_enqueue_styles' );
    ?>

So I fiddled around with the functions.php above - not sure if it's right. Then I jumped over to my style.css page and made some edits to the header and now in the wordpress themes panel, it says the parent theme does not exist. This is very confusing to me because in that same panel is the theme Radiate. In fact, I set it to my active theme just to see if it is there. When I go to the theme errors it gives me the option to install a parent theme. when I click install it says the theme fails to install because the destination folder already exists. I have heard about errors in the child theme header messing things up so here is mine.

/*
 Theme Name:   Radiate Child
 Theme URI:    https://themegrill.com/themes/radiate/
 Description:  Radiate Child Theme
 Author:       ThemeGrill
 Author URI:   https://themegrill.com/
 Template:     Radiate
 Version:      1.0.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:  radiate-child
*/

here is the original

/*
Theme Name: Radiate
Theme URI: https://themegrill.com/themes/radiate/
Author: ThemeGrill
Author URI: https://themegrill.com/
Description: Radiate is a clean, creative and light retina ready responsive blogging theme supporting parallax header image. It integrates primary color option, custom background, custom css and few other features through WordPress customizer. The theme is translation ready and you can get free support on https://themegrill.com/support-forum. View demo at https://demo.themegrill.com/radiate.
Version: 1.2.7
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: radiate
Domain Path: /languages/
Tags: two-columns, right-sidebar, custom-header, flexible-header, custom-background, custom-menu, custom-colors, post-formats, sticky-post, threaded-comments, translation-ready, featured-images, rtl-language-support, theme-options, blog, e-commerce

Resetting and rebuilding styles have been helped along thanks to the fine work of
Eric Meyer http://meyerweb.com/eric/tools/css/reset/index.html
along with Nicolas Gallagher and Jonathan Neal http://necolas.github.com/normalize.css/
and Blueprint http://www.blueprintcss.org/
*/


/* =Reset

side note: when I select live preview for the child theme (when it was previously visible in the theme panel) and radiate it loads a blank page that just says "google analytics" at the top. This does not happen when the theme is activated.

EDIT: changed the template name to 'radiate' which makes it appear in the themes panel. clicking live preview or activating the theme turns everything into 500 errors.

EDIT 2: this is the code I get in the error_log

PHP Warning: PHP Startup: Unable to load dynamic library '/opt/cpanel/ea-php56/root/usr/lib64/php/modules/pdo_pgsql.so' - /opt/cpanel/ea-php56/root/usr/lib64/php/modules/pdo_pgsql.so: cannot open shared object file: No such file or directory in Unknown on line 0
  • in the `style.css` header of your child theme ` Template: ` should be not your parent theme name, but it's folder name – Samvel Aleqsanyan Mar 29 '18 at 20:20
  • @samvelAleqsanyan okay so now the child theme is available in the theme panel again but when I click live preview it sends me to a http 500 error page. same thing for when I activate it. I'm not sure what's wrong with the php code –  Mar 29 '18 at 20:31
  • of course you'll get it. you have 2 functions with the same name in the `functions.php` file. rename one of them – Samvel Aleqsanyan Mar 29 '18 at 20:33
  • also, there is no need to open and close php tags( `` ). remove all of them except first one – Samvel Aleqsanyan Mar 29 '18 at 20:34
  • @samvelAleqsanyan that seems to have solved most of it. but now i'm in the theme's settings in the wordpress panel and I cannot edit anything. anytime i click on a link it just redirects to a blank page with google analytics written on the top. zero css transfers over. the exact same problem i mentioned in my sidenote at the bottom. is there anything in the functions.php or style.css code that will allow me to link to the theme settings in wordpress? –  Mar 29 '18 at 20:50
  • turn on debug mode and provide error logs: [How To Turn on Debug Mode](https://stackoverflow.com/a/47856127/8053001) – Samvel Aleqsanyan Mar 29 '18 at 21:00
  • @samvelAleqsanyan check my last edit –  Mar 29 '18 at 22:37
  • 1
    @samvelaleqsanyan there was an issue with one of the plugins. i deactivated it and now it works from what I can tell –  Mar 29 '18 at 23:16
  • so, it's working ok now? – Samvel Aleqsanyan Mar 30 '18 at 00:12
  • @samvelAleqsanyan yes it is –  Mar 30 '18 at 18:06

0 Answers0