Child theme edits wont show up

`Hello Themeco Team,

I copied the global from my main x theme file which is \wp-content\themes\x\framework\views\global\ _content-none.php

and copied the global file into my child theme

Then edited the “Nothing to show here right now” comment that displays when there is nothing to show for the search.

After editing, and caching, the changes still have not shown up. Any thoughts? Im developing my website with a coming soon page plugin activated. If i need to grant access to my site i will.

Thanks!

Hey @wanderlust,

Did you copy the file in the same directory structure \x-child\framework\views\global\?

Try using the gettext filter to change text in WordPress. Here’s a sample code.

add_filter( 'gettext', 'change_texts', 20, 3 );

function change_texts( $translated_text, $text, $domain ) {

    if ( is_search() ) {

        switch ( $translated_text ) {

            case 'Nothing to Show Right Now' :

                $translated_text = __( 'Nothing', '__x__' );
                break;
        }

    }

    return $translated_text;
}

Thanks.

Where would I input this code? The folder structure? And yes, i copied the whole global file from my main theme and pasted it into my child theme. Then proceeded to edit the file “no content”

Hi There,

Thanks for asking!

The above code should go in to the child theme foction.php file. If that doesn’t help please send us your login details and FTP with your bebsite URL in a secure note so that we can have a look.

Thanks

Yes, I apologize but it did not work. And sounds great, i will attach as a secure note. (I am using a lot of dummy content at the moment by the way) But while your back there…

Could you take a look to see if you can disable uber menu on mobile? It won’t turn off for me and I would like to just have my X menu show on mobile.

and

Could you explain to me how I could add custom sidebars? Any good plugins for this??

Thank-you for all of your help, I am getting more comfortable with everything and I am very for the fact that I can accomplish some things on my own now.

Hi There,

If that is a siteground login credentials, unfortunately it is not working. Please double check.

What kind of sidebar are you trying to achieve? This guide might help:

No need for plugins for custom sidebars. It would also help sharing your site URL and credentials. Thank you.

Awesome i will check that out! And here you go. I must have gotten the info confused.

Hi there,

To change the text which is generated in the theme itself you need to follow the same steps you would do to translate the theme but instead of translating to another language you can simply change the text to whatever you want. For more information:

Also, the FTP information did not work. Kindly contact the Siteground and ask them to give you:

FTP Server Address
FTP Port Number
FTP Username
FTP Password

Meanwhile kindly give us the login information for your Wordpress dashboard including:

Wordpress admin URL
Admin USername
Admin Password

As we can use the Appearance > Editor menu to access the functions.php file and try to test the case there if needed.

Thank you.

Okay, as of right now I have dummy content on the website for testing purposes. Thank-you for all of your help!

I’m also going to repost my comment after this sentence from earlier to see if you can check out these problems that have been bothering me.

Could you take a look to see if you can disable uber menu on mobile? It won’t turn off for me and I would like to just have my X menu show on mobile or tablets.

and

Can you see if you can line up the items in my menu somehow?

Hi,

You forgot to include your site url.

Please provide us your wordpress admin login url so we can check.

Thanks

Okay, just updated. Sorry about that!

The code I gave previously works. Please look at this.

What page did you test it on? If tested on your blog page, you should change this part of the code if ( is_search() ) to this if ( is_search() || is_archive() )

Please see the rest of WordPress’ conditional tags like is_search here.

Please note that we used custom code here. Issues arising from the use of it and further enhancement would be outside the scope of our support.

Thank you for understanding.

Did you insert that code into the global file that I copied into my child theme? And what about the text that’s under it?

Hi There,

What you did here works fine on my end. If this did not work on your end, please double check that you actually added the file to /x-child/framework/views/global/ then clear and deactivate your caching plugin and browser’s cache.

If that does not work, please provide us FTP credentials in a secure note so we can take a look on how you setup the child theme. Yes we can check the file on Appearance > Editor but we can not confirm if that is on the correct path.

And we kindly ask to create a new thread for your menu issues, because the thread will be confusing if we answer that here.

Thanks,

Okay, I will provide them in a secure note. I would really like to be able and make custom edits but I’m not sure if I did it correctly, because nothing is showing up. Please explain what i did wrong, and what to do next time. Thankyou!!! :sunglasses:

Hello There,

Nothing is working in your child theme because you have added it in the wrong folder. For example, you want to change the contents of content-none.php file.
It is located here:

\wp-content\themes\x\framework\views\global\ _content-none.php

when you modify it and place in your child theme, it should be located here:

\wp-content\themes\x-child\framework\views\global\ _content-none.php

Right now, you set up the wrong folder path. You are only having \wp-content\themes\x-child\global\.

By the way, Christian’s code that works were added in the child theme’s functions.php file located in \wp-content\themes\x-child\functions.php

Hope this helps.

So what do you suggest that i do to fix it? I dont want to break anything

Hi,

You need to delete the file you added _> /wp-content/themes/x-child/global/_content-none.php

Then add the code provided by my colleague in /wp-content/themes/x-child/functions.php

This is the code

add_filter( 'gettext', 'change_texts', 20, 3 );

function change_texts( $translated_text, $text, $domain ) {

    if ( is_search() ) {

        switch ( $translated_text ) {

            case 'Nothing to Show Right Now' :

                $translated_text = __( 'Nothing', '__x__' );
                break;
        }

    }

    return $translated_text;
}

Thanks

Okay i fixed the problem, now i know what i have to do for next time. How would i go about changing the text for an empty category? If you go to an empty category it wont display the text that i changed the code to. Also, how would i go about editing the sub text? Under the “Nothing to show right now”

  • Thanks

Hi there,

Similarly, you can add the following code into your child theme’s functions.php file and change the text content accordingly.

add_filter( 'gettext', 'my_empty_category', 20, 3 );

function my_empty_category( $translated_text, $text, $domain ) {

    if ( is_category() ) {

        switch ( $translated_text ) {

            case 'Nothing to Show Right Now' :

                $translated_text = __( 'Empty Category', '__x__' );
                break;
        }

    }

    return $translated_text;
}

In case if you want to use the same text as for search page, update the earlier code as follows and ignore my above code.

add_filter( 'gettext', 'change_texts', 20, 3 );

function change_texts( $translated_text, $text, $domain ) {

    if ( is_search() OR  is_category() ) {

        switch ( $translated_text ) {

            case 'Nothing to Show Right Now' :

                $translated_text = __( 'Nothing', '__x__' );
                break;
        }

    }

    return $translated_text;
}

Hope that helps.