-
AuthorPosts
-
November 21, 2014 at 4:12 pm #355229
Hi guys,
I try to connect files from child theme with parent theme. I need some files from folder */images and */lang from parent theme to be kept after updating the theme. So I created folders images and lang in child theme folder and put these files there.
When I go to functions.php file in child theme and try to use this code my site crashes:
require_once( get_stylesheet_directory(). '/lang/ru_RU.mo' );
It doesn’t matter if I put .mo file or .jpg, anyway happens something wrong.
What do I do wrong?November 21, 2014 at 6:11 pm #355376Hey!
That may be happening because the file you are trying to include doesn’t exists in the server, i’d suggest using include instead:
include( get_stylesheet_directory(). '/lang/ru_RU.mo' );
Cheers!
JosueNovember 21, 2014 at 11:20 pm #355674Hey Josue!
Thanks for reply, however it didn’t work – same issue.
Why do you think the file might not be on the server? I uploaded .mo and .po files into */enfold-child/lang folder. Style.css, functions.php and other php files included in child theme work correctly, but files like .png, .mo, .po etc don’t work.
You can see the chaotic symbols on grey background above header. The more information in the file I try to include, the bigger this area.
Best regards,
EvgenyNovember 22, 2014 at 12:20 am #355717Hi Evgeny!
Can you translate that text? what does it say?
Cheers!
JosueNovember 22, 2014 at 10:42 am #355843Hi Josue!
This is just the small part of this text:
���DQl>�S�S*�S�STT�$TK�T5UIUZU \UfUrU wU �U �U�U �U�U �U6�U�UV8V >VHVYVbVHV4�V�VW WW0W AWHOW��WB=X�XE�X�X!�XY%Y>Y]YnY�Y�Y�Y%�Y �Y�Y ZZ2Z:ZRZgZ~Z�Z�Z �Z�Z�Z6�Z&�Z6″[ Y[d[�[“�[�[?�[\�\�\�\�\�\]]1]>]G]Z] o]z]�]�]�]i�])^=^S^m^ ^0�^�^�^�^ �^�^__+_ >_ I_T_ Y_ c_q_}_�_ �_�_ �_�_�_�_�_�_�_�%
�
��
��
�aa"a5aBa4Ra/�a��a�:bF�b9:ctc�c�c�c#�c)�c&d-d$Bd�gdWeFXe#�e+�e2�e%"f(Hf&qf#�f"�f'�f$g!,g>Ng!�g �g#�g)�g.hPMh�h�h�h�h�h!�h"i7i Di Ri
i fiqi �i�i�i�i�i�i�i�i�i�ij jF$jkjsjB|j�j�j�j6 kDk#]k�k$�k%�k-�k5l9Pl�l&�l&�l&�l&m&Bm&im”�m�m�m�m nnn3nKnXnhnzn�n�n�n�n�n�nooo)o 1o?oNo ]oko{o�o �o�o�o�o*�op pp’p6pBpUp^prpzp�p�p�p2�p�pqq2qGqq zq�q�q�q!�q�qVr#lr&�r,�r"�r8s8@sys�s&�s�s&�stt)tBt@Zt#�t$�t�tpuqu�u$�u,�u*�u*"vLMv��vB&w2iw(�wD�w" x.-xO\x�x$�xD�x,y�HA�A��Ḃ<��4L�,��p����c����5��7ӊ���.�3�L� T�b�q� ��+��'(��%�,9�#f������� �� �� �� Č Ҍ ܌�� ��Y�,\����P�Wb���"Ԏ���� ��3�?�T�8h�4��.֏��/�;�H�O� \�j�~���=��������9�"U�x�1����ݑ��X��KU����� �� ʒؒ�� ��� � �1+�]� b�yp����� ���.�=�M�Z�g� t����� �� ���� ���� Д۔����O�R�a�Hh�����ȕ ە����3��+�e0�+�� ϖږߖ����'� ;�F�]�b�e�l�/t��� ����#җ �� � ��0� H�$V�#{�m�� �"�&2�Y�)x�c��/�)6�
�e�l� ~��� ��������ؚ �� ����+�/I�y�������֛����� �”�1� 6�D�Q� W�b� w�������”�7’�_�~�������ϟ���After these symbols there is text from translation in both languages:
installed and activated successfully.%1$s installed successfully.« Older Comments(Edit)(It is recommended to only activate this if you receive spam from your contact form, since an invisible spam protection is also implemented that should filter most spam messages by robots anyways)(Note: Images will be scaled to fit for the amount of columns chosen above)(Show Styling Page)(Unnamed Slider).1 Columns1 Pixel Gap16:92 Columns3 Columns4 Columns404 – Page not Found404 Not Found4:35 ColumnsA list of all supported Video Services can be found onAnd then the symbols again.
Though it started catching the files.
I’ve noticed, that the symbols appear only if I login as adminNovember 23, 2014 at 6:17 pm #356289Hi!
Why do you want to keep the ru_RU.mo file on the child theme folder? Is this for the Codestyling Localization plugin? You can simply add the lang folder on the child theme then include the language file that you want to preserve it in case you update the theme.
Regards,
IsmaelNovember 24, 2014 at 10:03 pm #357156Hi Ismael,
But this is exactly what I’m trying to do. I created lang folder in the child theme folder and put there language files.
When I insert the codes from above into the child theme functions.php file, I see the mess in the header. Don’t understand why it happens, I do as wordpress codex and you guys tell me, but something goes wrong.Best regards,
EvgenyNovember 24, 2014 at 10:24 pm #357166Ismael, I’ve actually seen the code you had posted before you deleted it. Is it correct?
add_action('after_setup_theme', 'avia_child_lang_setup'); function avia_child_lang_setup() { remove_action('after_setup_theme', 'avia_lang_setup'); $lang = get_stylesheet_directory() . '/lang'; load_theme_textdomain('avia_framework', $lang); var_dump($lang); }
I tried this code, now it looks much better – only one line with error and the header sticked one line from the top when I scroll the page.
This is the message I see above the header:
string(76) “/home/e/evdubi/dubinchuk.com/public_html/wp-content/themes/enfold-child/lang”November 25, 2014 at 5:18 am #357334Hi!
Yes, I added it by I don’t think it will work on your end hat is why I deleted it. It should specify the lang folder on the child theme as main language folder. If it works, just remove this part:
var_dump($lang);
Best regards,
IsmaelNovember 25, 2014 at 9:15 am #357410Thanks a lot, Ismael! It worked for me!
Kriesi support is awesome!Regards,
Evgeny -
AuthorPosts
- The topic ‘How to connect files from child theme with parent theme’ is closed to new replies.