Viewing 15 replies - 1 through 15 (of 20 total)
  • Thread Starter lgehrig4

    (@lgehrig4)

    On the first line I meant that “I’m having difficulty enqueueing the stylesheet thats in theme’s child directory”.

    Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    >> `3rd line of code gives me this
    console
    GET net::ERR_ABORTED 404` <<

    What is the actual path to your CSS file?

    You said the file is

    home > public_html > wp-content > themes > phlox-child > fonts > MyFontsWebfontsKit.css

    Please show a screenshot of that directory. Thanks.

    Moderator bcworkz

    (@bcworkz)

    In your third attempt you enqueue a hard coded URL, yet the console logs a different URL, one with public_html inserted. It appears there is some sort of redirect rule modifying requests, but I think if that were the case you’d have trouble with other requests besides your stylesheet.

    To reduce the possible causes, what is the actual URL that appears in the page’s source HTML (the <link> meta tag for your stylesheet in the <head> section)? Does it include public_html or not?

    Thread Starter lgehrig4

    (@lgehrig4)

    @sterndata
    @bcworkz

    screenshot
    https://i.imgur.com/q0yfr6s.png

    Copied directly from the input as seen in the screenshot above
    public_html/wp-content/themes/phlox-child/fonts

    1st line code HTML results
    <link rel=’stylesheet’ id=’custom-css’ href=’https://equipourkids.org/wp-content/themes/phlox/fonts/MyFontsWebfontsKit.css?ver=5.5&#8242; type=’text/css’ media=’all’ />

    <link rel=”stylesheet” type=”text/css” href=”/public_html/wp-content/themes/phlox-child/fonts/MyFontsWebfontsKit.css”>

    2nd line code HTML results
    <link rel=”stylesheet” type=”text/css” href=”/public_html/wp-content/themes/phlox-child/fonts/MyFontsWebfontsKit.css”>

    3rd line code HTML results
    <link rel=”stylesheet” type=”text/css” href=”/public_html/wp-content/themes/phlox-child/fonts/MyFontsWebfontsKit.css”>

    Note: 1st line of code outputs 2 links in the head. The 2nd and 3rd lines of code output the exact same thing.

    Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    The correct link is https://equipourkids.org/wp-content/themes/phlox-child/fonts/MyFontsWebfontsKit.css?ver=5.5 which should result from wp_enqueue_style( 'custom', get_stylesheet_directory_uri() . '/fonts/MyFontsWebfontsKit.css' );

    Thread Starter lgehrig4

    (@lgehrig4)

    Curious why you left out public_html? That is in the path from the screenshot.

    Either way, any suggestions as to where to troubleshoot?

    Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    A bit of debugging.

    Throw in

    $gsdu = get_stylesheet_directory_uri(); wp_die ( $gsdu );

    Thread Starter lgehrig4

    (@lgehrig4)

    This is getting stranger. I removed the code and pulled up a fresh page but this is still in the HTML source code.

    <link rel=”stylesheet” type=”text/css” href=”/public_html/wp-content/themes/phlox-child/fonts/MyFontsWebfontsKit.css”>

    So this must be coming from somewhere else, but I have no idea where?

    @sterndata This is what the web page displays after I enter that code

    https://equipourkids.org/wp-content/themes/phlox-child

    Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    I get a 403 trying to view that.

    OK, let’s try this bit of debugging.

    Add this to your child-theme’s functions.php file and put [show_directories] on a test page.

    
    function show_directories( $atts, $content {
       $gsdu = get_stylesheet_directory_uri();
       $gtdu = get_template_directory_uri();
    
       return 'stylesheet / template = ' . $gsdu . ' / ' .$gtdu;
    }
    add_shortcode( 'show_directories', 'show_directories');
    

    Also, please install the health check plugin and report back its findings from the info tab: https://www.ads-software.com/plugins/health-check/

    Thread Starter lgehrig4

    (@lgehrig4)

    Output from short code
    https://i.imgur.com/yF6GMTX.png

    Enabling health check put a scare into me. The dashboard changed, it told me the Twenty Twenty theme was activated (probably what they used before they switched to Phlox) and the site crashed.

    It gave me an option to swtich themes to Phlox but I immediately disabled troubleshooting until further notice.

    Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    I did not ask you to put it into troubleshooting mode. I just want the stuff from the info tab. Click the “copy” button to grab it all.

    The output you grabbed shows that “public_html” is not part of the URI, so I don’t know where that’s coming from.

    wp_enqueue_style( 'custom', get_stylesheet_directory_uri() . '/fonts/MyFontsWebfontsKit.css', array() ); should produce the correct result.

    Thread Starter lgehrig4

    (@lgehrig4)

    Still nothing. I have to check with the site admin to see what he did. He told me that he just followed this one step below, but if that were the case I’m not sure how the link tag just popped up

    Upload the contents of the Kit to your server. This is typically done using some type of FTP program — the same way that you upload images and other files to your website. Typically it is easiest if you upload all the files and folders to the root folder of your site. You can alternately create a subfolder (or use an existing one) and put the Kit there, put them wherever you want. Be sure to make note of the location you’ll need it in step two.

    This comes up in HTML every time even with no code.
    <!–
    /**
    * @license
    * MyFonts Webfont Build ID 749007
    *
    * The fonts listed in this notice are subject to the End User License
    * Agreement(s) entered into by the website owner. All other parties are
    * explicitly restricted from using the Licensed Webfonts(s).
    *
    * You may obtain a valid license from one of MyFonts official sites.
    * https://www.fonts.com
    * https://www.myfonts.com
    * https://www.linotype.com
    *
    */
    –>

    Your code produced this error, but the path looks good
    GET https://equipourkids.org/public_html/wp-content/themes/phlox-child/fonts/MyFontsWebfontsKit.css net::ERR_ABORTED 404

    Results of Health Check

    ### wp-core ###

    version: 5.5
    site_language: en_US
    user_language: en_US
    permalink: /%year%/%monthnum%/%day%/%postname%/
    https_status: true
    user_registration: 0
    default_comment_status: open
    multisite: false
    user_count: 10
    dotorg_communication: true

    ### wp-paths-sizes ###

    wordpress_path: /home/bigeqcam/public_html
    wordpress_size: 2.40 GB (2572998833 bytes)
    uploads_path: /home/bigeqcam/public_html/wp-content/uploads
    uploads_size: 2.16 GB (2314540163 bytes)
    themes_path: /home/bigeqcam/public_html/wp-content/themes
    themes_size: 20.42 MB (21413354 bytes)
    plugins_path: /home/bigeqcam/public_html/wp-content/plugins
    plugins_size: 159.02 MB (166749298 bytes)
    database_size: 108.17 MB (113426432 bytes)
    total_size: 4.83 GB (5189128080 bytes)

    ### wp-active-theme ###

    name: Phlox Child (phlox-child)
    version: 1.0
    author: averta
    author_website: (undefined)
    parent_theme: Phlox (phlox)
    theme_features: core-block-patterns, post-thumbnails, post-formats, woocommerce, html5, gallery, customize-selective-refresh-widgets, custom-logo, auxin-portfolio, auxin-shop, automatic-feed-links, title-tag, menus, starter-content, infinite-scroll, wc-product-gallery-zoom, wc-product-gallery-slider, header-footer-elementor, widgets, editor-style
    theme_path: /home/bigeqcam/public_html/wp-content/themes/phlox-child

    ### wp-parent-theme ###

    name: Phlox (phlox)
    version: 2.6.11
    author: averta
    author_website: https://www.averta.net
    theme_path: /home/bigeqcam/public_html/wp-content/themes/phlox

    ### wp-themes-inactive (1) ###

    Twenty Twenty: version: 1.5, author: the WordPress team

    ### wp-mu-plugins (2) ###

    Health Check Troubleshooting Mode: author: (undefined), version: 1.7.1
    p3-profiler.php: author: (undefined), version: (undefined)

    ### wp-plugins-active (25) ###

    Analytify – Google Analytics Dashboard: version: 3.1.3, author: Analytify
    Autoptimize: version: 2.7.6, author: Frank Goossens (futtta)
    Classic Editor: version: 1.6, author: WordPress Contributors
    Duplicate Page: version: 4.2, author: mndpsingh287
    Elementor: version: 2.9.14, author: Elementor.com
    Elementor Pro: version: 2.10.3, author: Elementor.com
    Envato Elements: version: 2.0.5, author: Envato
    GA Google Analytics: version: 20200815, author: Jeff Starr
    GTranslate: version: 2.8.58, author: Translate AI Multilingual Solutions
    Health Check & Troubleshooting: version: 1.4.4, author: The www.ads-software.com community
    Insert Headers and Footers: version: 1.4.6, author: WPBeginner
    MC4WP: Mailchimp for WordPress: version: 4.8, author: ibericode
    Phlox Core Elements: version: 2.6.10, author: averta
    Phlox Portfolio: version: 2.0.1, author: averta
    Plugin Notes Plus: version: 1.2.2, author: Jamie Bergen
    SG Optimizer: version: 5.6.4, author: SiteGround
    Share This Image: version: 1.43, author: ILLID
    Smush: version: 3.6.3, author: WPMU DEV
    Stop Spammers: version: 2020.4.5, author: Trumani
    UpdraftPlus – Backup/Restore: version: 1.16.26, author: UpdraftPlus.Com, DavidAnderson
    VFB Pro: version: 3.4.3, author: Matthew Muro
    VFB Pro – Notifications: version: 2.0.7, author: Matthew Muro
    WooCommerce: version: 4.4.1, author: Automattic
    WP-Sweep: version: 1.1.3, author: Lester ‘GaMerZ’ Chan
    Yoast SEO: version: 14.8, author: Team Yoast

    ### wp-media ###

    image_editor: WP_Image_Editor_GD
    imagick_module_version: Not available
    imagemagick_version: Not available
    gd_version: bundled (2.1.0 compatible)
    ghostscript_version: 9.26

    ### wp-server ###

    server_architecture: Linux 3.12.18-clouder0 x86_64
    httpd_software: Apache
    php_version: 7.3.16 64bit
    php_sapi: cgi-fcgi
    max_input_variables: 3000
    time_limit: 120
    memory_limit: 768M
    max_input_time: 120
    upload_max_size: 128M
    php_post_max_size: 128M
    curl_version: 7.59.0 OpenSSL/1.0.2r
    suhosin: false
    imagick_availability: false
    server-headers:
    server: nginx
    date: Wed, 19 Aug 2020 19:46:50 GMT
    content-type: text/html; charset=UTF-8
    pragma: no-cache
    expires: Wed, 11 Jan 1984 05:00:00 GMT
    cache-control: no-cache, must-revalidate, max-age=0
    x-cache-enabled: True
    link: <https://equipourkids.org/wp-json/&gt;; rel=”https://api.w.org/&#8221;, <https://equipourkids.org/wp-json/wp/v2/pages/6138&gt;; rel=”alternate”; type=”application/json”, <https://equipourkids.org/&gt;; rel=shortlink
    set-cookie: wpSGCacheBypass=1; expires=Wed, 19-Aug-2020 21:26:48 GMT; Max-Age=6000; path=/; HttpOnly; SameSite=Lax
    content-security-policy: upgrade-insecure-requests
    alt-svc: quic=”:443″; ma=86400; v=”43,39″
    host-header: b7440e60b07ee7b8044761568fab26e8
    x-proxy-cache: BYPASS
    htaccess_extra_rules: true

    ### wp-database ###

    extension: mysqli
    server_version: 5.6.40-84.0-log
    client_version: mysqlnd 5.0.12-dev – 20150407 – $Id: 7cc7cc96e675f6d72e5cf0f267f48e167c2abb23 $

    ### wp-constants ###

    WP_HOME: undefined
    WP_SITEURL: undefined
    WP_CONTENT_DIR: /home/bigeqcam/public_html/wp-content
    WP_PLUGIN_DIR: /home/bigeqcam/public_html/wp-content/plugins
    WP_MAX_MEMORY_LIMIT: 768M
    WP_DEBUG: false
    WP_DEBUG_DISPLAY: true
    WP_DEBUG_LOG: false
    SCRIPT_DEBUG: false
    WP_CACHE: false
    CONCATENATE_SCRIPTS: undefined
    COMPRESS_SCRIPTS: undefined
    COMPRESS_CSS: undefined
    WP_LOCAL_DEV: undefined

    ### wp-filesystem ###

    wordpress: writable
    wp-content: writable
    uploads: writable
    plugins: writable
    themes: writable
    mu-plugins: writable

    `

    Thread Starter lgehrig4

    (@lgehrig4)

    Forgot to paste this. It’s the link that seems to have been generated out of nowhere. Sits below the comments I pasted above and also receives a 404 error

    <link rel=”stylesheet” type=”text/css” href=”/public_html/wp-content/themes/phlox-child/fonts/MyFontsWebfontsKit.css”>

    Thread Starter lgehrig4

    (@lgehrig4)

    I’m contacting the Admin. I think he pasted that code into one of the files. I’ll update here when rectified. Thank you so much for your assistance!

    Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    I think you’re right.

Viewing 15 replies - 1 through 15 (of 20 total)
  • The topic ‘Trying to load Custom CSS file’ is closed to new replies.