Tomi
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Creating Child Theme: Two different functions.php instructionsYes, it was coincidentally something else that happened on the hosting side. The second set of code didn’t work either, but it’s OK.
I got an email back from the theme dev and they gave me the instructions. I had to delete the child theme, go into the advanced options and copy the theme options data characters, create the child theme through the setup wizard, then copy the data into the same spot for the child. The functions.php doesn’t really have anything in it surprisingly!
Thanks for the help while I work through in understanding this stuff 🙂
Regards,
TomiForum: Fixing WordPress
In reply to: Creating Child Theme: Two different functions.php instructionsIn the flatsome theme in the functions.php, it has
get_templatebut yes, as I see now, the file I referenced hadget_stylesheet_uri()as the 2nd parameter. I changed to the second set of code, but now I’m locked out of my website. I don’t know if this broke my WordPress or what. Only way I could get in was via FTP (Domain hosting File Manager refused to accept my username/password) and I changed the function.php back. Still locked out because “Domain status: not pointing to our name servers”. Contacted my hosting support. This is a lot more confusing and frustrating than I thought it would be. I don’t know what to do besides wait for support from the theme support and domain support.Thanks for taking the time to help.
Forum: Fixing WordPress
In reply to: Creating Child Theme: Two different functions.php instructionsI think you need to be more clear in exactly what needs to be replaced in this bit of code:
add_action( 'wp_enqueue_scripts', 'my_theme_enqueue_styles' ); function my_theme_enqueue_styles() { wp_enqueue_style( 'child-style', get_stylesheet_uri(), array( 'parenthandle' ), wp_get_theme()->get('Version') // this only works if you have Version in the style header ); }Do I replace both ‘child-style’ and ‘parenthandle’, as well as anything else?
What specifically do I replace them with, respectively? I’ve been trying combinations, but I fundamentally don’t understand what the placeholders need to be replaced with.I did a
grep -rli "wp_enqueue_style" *search in the flatsome theme, list is at the bottom. I went through it and found the first parameter differs in each file. The definition of the first parameter is the name of the stylesheet. I would think the name of the flatsome theme stylesheet is calledstyle.css, as shown in my theme editor.The definition for the third parameter is An array of registered stylesheet handles this stylesheet depends on. I don’t know about this one, not even a guess… until…
I went through the list at the bottom, as well as did some comparisons with the file you referenced and found a match. I went into that file and found “flatsome-style” as one of the (wp_enqueue_style) functions first parameter, which looks much more promising than the rest first-parameter-matches from other files found below:
flatsome-header-builder-css
flatsome-panel-css
flatsome-main
flatsome-main-rtl
…- Found on line 130 of wp-content/themes/flatsome/inc/functions/function-setup.php
// Load current theme styles.css file. if ( ! get_theme_mod( 'flatsome_disable_style_css', 0 ) ) { wp_enqueue_style( 'flatsome-style', get_stylesheet_uri(), array(), wp_get_theme()->get( 'Version' ), 'all' ); }At current moment, this is my child theme functions.php file:
<?php add_action( 'wp_enqueue_scripts', 'my_theme_enqueue_styles' ); function my_theme_enqueue_styles() { wp_enqueue_style( 'style.css', get_stylesheet_uri(), array( 'flatsome-style' ), wp_get_theme()->get('Version') // this only works if you have Version in the style header ); } // replaced child-style with style.css & parenthandle with flatsome-style ?>List of files with
wp_enqueue_stylefound:
inc/shortcodes/ux_banner.php
inc/shortcodes/ux_countdown/ux-countdown.php
inc/shortcodes/sections.php
inc/functions/function-fonts.php
inc/functions/function-setup.php
inc/extensions/flatsome-shortcode-insert/tinymce.php
inc/integrations/integrations.php
inc/integrations/wc-yith-wishlist/yith-wishlist.php
inc/classes/class-tgm-plugin-activation.php
inc/classes/class-wc-product-data-fields.php
inc/helpers/helpers-icons.php
inc/builder/core/server/templates/media.php
inc/builder/core/server/templates/tinymce.php
inc/builder/core/server/actions/editor.php
inc/builder/core/server/actions/iframe.php
inc/admin/envato_setup/envato_setup.php
inc/admin/gutenberg/class-gutenberg.php
inc/admin/kirki/modules/tooltips/class-kirki-modules-tooltips.php
inc/admin/kirki/modules/custom-sections/class-kirki-modules-custom-sections.php
inc/admin/kirki/modules/css/class-kirki-modules-css.php
inc/admin/kirki/controls/php/class-kirki-control-dimensions.php
inc/admin/kirki/controls/php/class-kirki-control-base.php
inc/admin/panel/panel.php
inc/admin/customizer/customizer-config.php
inc/admin/advanced/functions/functions.interface.phpThanks for continuing to help
- This reply was modified 5 years, 10 months ago by Tomi.
Forum: Fixing WordPress
In reply to: Creating Child Theme: Two different functions.php instructionsI have no idea and I am completely lost. All my theme customization’s such as the header bar, logo, etc, are all gone. Maybe it is because I did it wrong. I do not understand. In my parent theme’s functions.php there is no function
wp_enqueue_style. This is all there is:<?php /** * Flatsome functions and definitions * * @package flatsome */ require get_template_directory() . '/inc/init.php'; /** * Note: It's not recommended to add any custom code here. Please use a child theme so that your customizations aren't lost during updates. * Learn more here: http://codex.ww.wp.xz.cn/Child_Themes */ ?>- This reply was modified 5 years, 10 months ago by Tomi.
Forum: Fixing WordPress
In reply to: Creating Child Theme: Two different functions.php instructionsI see… The Hostinger instructions related to the condition which does not apply to me, hence, the different code. That pretty much clears things up. I’m still curious about array( ‘parenthandle’ ). I did look up the function definition for wp_enqueue_style which says:
wp_enqueue_style( string $handle, string $src = '', string[] $deps = array(), string|bool|null $ver = false, string $media = 'all' )$deps
(string[]) (Optional) An array of registered stylesheet handles this stylesheet depends on.
Default value: array()So, where is parenthandle located, and what does the above parameter mean in plain English?
Forum: Plugins
In reply to: [YITH WooCommerce Wishlist] How to remove Wishlist titleYea I don’t think so either (even though it looked bang on).
I will contact theme support and update later.
Thanks for the help and mentoring me through using .php for the first time! I was surprisingly delighted to find out how much it resembles C ^.^
Regards
Forum: Plugins
In reply to: [YITH WooCommerce Wishlist] How to remove Wishlist titleUnfortunately, it did not remove the title I was referring to, but the ‘title’ directly above the wishlist. I am referring to the page title itself. https://ibb.co/DfXK0dG
Hopefully my flatsome theme isn’t conflicting with this ability? I flushed the cache, also the dns cashe. I don’t know if that was necessary but hey, I did it. I also tried replacing page_title with some other things but to no avail.
Thanks again for the quick response.
- This reply was modified 5 years, 10 months ago by Tomi.
I’ve had a conflict issue as well and my site is pretty darn minimalistic. It really caught me off gaurd and I thought it was something else. I really hope Yoast SEO takes a close look because I don’t have any wild or fancy plugins, and I was using Astra theme.