Home Forums Weaver Xtreme Theme Child Theme Steps

Viewing 16 posts - 1 through 16 (of 22 total)
  • Author
    Posts
  • #70893
    GR8FL
    Participant

    Can someone point me in the right direction for the exact steps to make a child theme from Weaver Xtreme?

    It’s been a while since I last did this and searching through this forum as well as the how-to-guides has not shown what I am looking for.

    Thanks.

    #70894
    scrambler
    Moderator

    I believe the Xtreme installation already includes a demo child theme. If you go to themes, check if you see it.

    If you do, then you can just edit the PHP  files in that child, and activate the theme.

    Why do you need a child?

    #70895
    GR8FL
    Participant

    I have to add the following to the functions.php. Perhaps it can go into the wp-config.php

     

    $tsml_columns = array(
        'region' => 'Region',
        'time' => 'Time',
        'distance' => 'Distance',
        'name' => 'Name',
        'location' => 'Location',
        'address' => 'Address',
        'types' => 'Types'
    );
    #70896
    scrambler
    Moderator

    @weaver would have to comment.

    To avoid the child theme, I would try adding it in the Actions and filter box.

    If it does not work there, then you will need a child theme and put that in the child theme function.php file

    #70897
    GR8FL
    Participant

    How do I activate the theme? I see the child theme folder in my theme folder.

    #70898
    scrambler
    Moderator

    Appearance > Theme > activate the theme like any other theme 🙂

    #70899
    GR8FL
    Participant

    Does everything I have in my current theme carry over into the child automatically? And all I have to do is add whatever is different, in this case, to the functions.php?

    >>Appearance > Theme > activate the theme like any other theme

    I don’t see the child in there. Do I need to place it somewhere else other than the folder public_html>wp-content>themes>weaver-xtreme>weaverx-mychild?

    #70901
    scrambler
    Moderator

    @weaver will have to confirm the exact location. I think the child theme folder needs to be moved in the Theme folder, not inside the xtreme theme folder

    #70902
    GR8FL
    Participant

    I’ll wait for @weaver to reply. This is a bit confusing.

    And one more thing, I haven’t been receiving any notifications by email on replies for a few weeks. This was a problem in the beginning, then it cleared up, and now seems to be an issue again.

    Thanks.

    #70903
    scrambler
    Moderator

    I check where my weaverx-child-demo folder was located and it is indeed inside public_html > Website > wp-content > Themes

    #70904
    GR8FL
    Participant

    Yes, that’s where mine is. Yet I don’t see how to activate it from >Appearance > Theme >

    #70905
    scrambler
    Moderator

    If that is  where the folder is, then in Appearance > theme you should see ALL installed theme, Weaver Xtreme, WordPress themes like 2021, others…. and one of them should the Weaver Child theme example (scroll down that page to be sure you see them all).

    If not I have no idea

    #70906
    GR8FL
    Participant

    This is confusing for someone who hasn’t much experience doing this.

    I need to add some functionality to the site, but obviously do not want to add to the theme functions.php because it will get overwritten the next time there’s a theme update.

    I found the weaverx-child-demo folder inside the public_html>
    wp-content>themes>weaver-xtreme folder. In the demo folder are 4 files:

    1. functions.php – which I took out the example code to change BG color and added mine. See below.
    2. Notes.txt – which I’ve left alone.
    3. screenshot.png – which I’ve made my own
    4. styles.css – which I changed only to reflect the name of the new child theme.

    I then copied the entire folder which contains the 4 files into the themes folder. Then I went to appearance > themes and selected that theme. The functionality that I wanted was great, but my header was missing and a lot of things were strange on the site.

    I reverted back to the parent theme and put the child folder back into the themes>weaver-xtreme folder.

    Here is the child functions.php

    <?php
    if ( ! defined( 'ABSPATH' ) ) {
    	exit;
    } // Exit if accessed directly
    /* This is the main function.php override file - it controls most of the stuff happening with the theme */
    
    /* Anything you need to actively do, put here. This is the first code that will get run whenever the
      child theme is activated and used. This example just re-defines a function, but you could do anything.
    */
    
    $tsml_columns = array(
        'region' => 'Region',
        'time' => 'Time',
        'distance' => 'Distance',
        'name' => 'Name',
        'location' => 'Location',
        'address' => 'Address',
        'types' => 'Types'
    );
    #70907
    scrambler
    Moderator

    Remember that when you change theme, WordPress sometimes screws up a number of things, like custom menus, widgets and so on.

    Once you activate the child theme, you may need to redo the settings for these

    #70908
    Weaver
    Keymaster

    Who or what is asking you to add that $tsml_columns statement? Having to add such a statement is highly unusual. Even adding it to a child functions.php seems weird. Normally, such a thing would be handled using the standard WordPress filter or action mechanism.

    There are many Weaver users who have used the actions and filters feature of Weaver, and there are pluging that can also support adding custom actions or filters. You case soulds as if it should be implemented as a filter.

    If this is a plugin, you should ask the plugin developer to add a filter for handling $tsml_columns via a filter. That is absolutely the correct WordPress way to do this. You should not need a child theme!

    #70910
    GR8FL
    Participant

    I was told if I wanted the plugin to behave a certain way from how it was setup that I could add the following to my theme functions.php. It was also suggested I could add it instead to the wp-config.php

    $tsml_columns = array(
        'region' => 'Region',
        'time' => 'Time',
        'distance' => 'Distance',
        'name' => 'Name',
        'location' => 'Location',
        'address' => 'Address',
        'types' => 'Types'
    );
Viewing 16 posts - 1 through 16 (of 22 total)
  • You must be logged in to reply to this topic.