Wordpress Themes - WP Forum at BFA
There will be no more development for Atahualpa (or any other theme), and no support. Also no new registrations. I turned off the donation system. I may turn the forum to read only if it gets abused for spam. Unfortunately I have no time for the forum or the themes. Thanks a lot to the people who helped in all these years, especially Larry and of course: Paul. Take care and stay healthy -- Flynn, Atahualpa developer, Sep 2021

Wordpress Themes - WP Forum at BFA » WordPress Themes » Atahualpa 3 Wordpress theme » Installation/Upgrade Issues »

Child Theme - CSS loading Problem (missing wp_enqueue_style in atahualpa)


  #1  
Old Jul 24, 2018, 04:16 AM
extremecarver
 
126 posts · Jul 2009
Hi - I can get the child theme to work - but only partially!

The problem is that following the wordpress codex - I have to know the parent_style name, which is supposed to be found by looking for
wp_enqueue_style
name in the style.css file - however for Atahualpa this does not exist.

So how can I write the child theme style.css in order to get further css from child theme loaded?


I need this in order to have fonts awesome loaded locally, however right now it only works if I copy the fonts-awesome folder directly into atahualpa folder, not if I copy it into the child theme so it survives updates.


(referring to https://codex.wordpress.org/Child_Themes )
__________________
Don't settle for lousy expensive Maps - Get free Maps based on Openstreetmap with great autorouting for cyclists, hikers and Mountainbikers at http://openmtbmap.org
  #2  
Old Jul 25, 2018, 02:49 AM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
Hi,
Can you give me details on what you have downloaded for FA, where you put it, what you put into a past/page to call the FA ICON.

I'll take a look, but it might not be till early next week. I have a son selling his house Friday, moving on Monday and they (he, his wife and two kids) staying with us with starting Thursday and the place is already a madhouse (grin)
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #3  
Old Jul 25, 2018, 04:28 AM
extremecarver
 
126 posts · Jul 2009
I've downloaded Font Awesome v 4.7.0:
https://fontawesome.com/v4.7.0/asset...some-4.7.0.zip

and unpacked it and placed a folder called font-awesome into the main directory of the child theme - there it does not work, in the main directory of atahualpa itself it works.

I have in my child theme -

style.css:
Code:
/*
Theme Name: atahualpa Child
Theme URI: https://www.velomap.org/atahualpa2-child/
Description: Child Theme für atahualpa
Version: 1.0
Author: Felix
Author URI: https://example.com
Template: atahualpa
License: GNU General Public License v2.0
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain:  atahualpa-child
*/

/* You can start adding your own styles here. Use !important to overwrite styles if needed. */
and functions.php I'm a bit lost - because I can not fully do it according to wordpress codex - right now I have only:
Code:
<?php
add_action( 'wp_enqueue_scripts', 'my_theme_enqueue_styles' );
function my_theme_enqueue_styles() {
    wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );

}

/* You can add your own php functions and code snippets below */

// Fix Shortcodes Ultimate from Loading Font Awesome Remotely
wp_register_style( 'font-awesome', get_template_directory_uri() . '/font-awesome/css/font-awesome.min.css', false, '4.7.0', 'all' );
?>
because for the full solution I would need to know what to enter for parent_style - and I cannot find out what value is needed for Atahualpa

Code:
<?php
function my_theme_enqueue_styles() {

    $parent_style = 'parent-style'; // This is 'twentyfifteen-style' for the Twenty Fifteen theme.

    wp_enqueue_style( $parent_style, get_template_directory_uri() . '/style.css' );
    wp_enqueue_style( 'child-style',
        get_stylesheet_directory_uri() . '/style.css',
        array( $parent_style ),
        wp_get_theme()->get('Version')
    );
}
add_action( 'wp_enqueue_scripts', 'my_theme_enqueue_styles' );
?>
Quote:
where parent-style is the same $handle used in the parent theme when it registers its stylesheet. For example, if the parent theme is twentyfifteen, by looking in its functions.php for its wp_enqueue_style() call, you can see the tag it uses there is 'twentyfifteen-style'. In your child code, replace the instance of 'parent-style' with 'twentyfifteen-style'

Without this value it will not load the css of the child theme folder except style.css file.
__________________
Don't settle for lousy expensive Maps - Get free Maps based on Openstreetmap with great autorouting for cyclists, hikers and Mountainbikers at http://openmtbmap.org
  #4  
Old Jul 26, 2018, 02:38 AM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
Ok, I need to reproduce this in the main Atahualpa folder first so I download the file, unzip it and change the name from 'font-awesome-4.7.0' to 'font-awesome' and put it in the Atahualpa folder.

1) Anything else?

2) What do I add to a post/page to see it work?

3) do you have a URL pointing to where you actually are using it?

(up early and have some time to look at this)
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #5  
Old Jul 26, 2018, 04:07 AM
extremecarver
 
126 posts · Jul 2009
well you need to create a child-theme - then put the font-awesome folder into the main atahualpa folder - that way it works.

It does not work however when the font-awesome folder is in the child-theme folder - because CSS files besides the styles.css are not loaded from there - as I do not know how to configure it with atahualpa (not sure if it even works with atahualpa - I guess it could work maybe using some not widely used functions?).


I use Font-Awesome together with Shortcodes Ultimate plugin:
https://wordpress.org/support/plugin...codes-ultimate

and due to GDPR legislation I want font-awesome to be loaded locally and not from netdna servers.


Font-Awesome is e.g. loaded here on my page:
https://openmtbmap.org/download/dem-relief-shading/

If you scroll down you see the yellow boxes that can be opened and closed. If font-awesome is not loaded correctly - instead of showing "-" and "+" icons to open/close the boxes - only an empty square will appear.


Code for that boxes with Shortcodes Ultimate installed:
Code:
[su_spoiler title="Some Title" style="fancy" open="yes"]

Content...

[/su_spoiler]

I also use some more adaptations via child-theme - but they are not css based or I put it in the style.css file which is loaded - so until now I did not notice child-theme does not fully work together with atahualpa.
__________________
Don't settle for lousy expensive Maps - Get free Maps based on Openstreetmap with great autorouting for cyclists, hikers and Mountainbikers at http://openmtbmap.org
  #6  
Old Jul 26, 2018, 06:06 AM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
Try this,
1) Move the font-awesome folder to wp-content
2) go to ATO->Add HTML/CSS Inserts->HTML Inserts: Header and add in a link:
HTML Code:
<link rel="stylesheet" href="
https://openmtbmap.org/wp-content/font-awesome/css/font-awesome.min.css" \>
and save it

Then test it out.

in my test I was able to add a
HTML Code:
<i class="fa fa-camera-retro"></i> fa-camera-retro
to a post and it shows fine. If this works for you, you won't need a child theme.
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #7  
Old Jul 26, 2018, 11:39 AM
extremecarver
 
126 posts · Jul 2009
This works only partly - iz actually loads from wp-content - BUT also from https://netdna.bootstrapcdn.com
So something is missing now to tell wordpress to stop loading it from netdna.

If I then use a child theme too - it will try to load from both - atahualpa theme folder, and wp-content.
__________________
Don't settle for lousy expensive Maps - Get free Maps based on Openstreetmap with great autorouting for cyclists, hikers and Mountainbikers at http://openmtbmap.org
  #8  
Old Jul 26, 2018, 03:06 PM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
did you remove the code you added to the functon node?
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #9  
Old Jul 27, 2018, 11:09 AM
extremecarver
 
126 posts · Jul 2009
The code I added was only added to the child theme, which I now of course deactivated. So there is no more added code in functions.php
__________________
Don't settle for lousy expensive Maps - Get free Maps based on Openstreetmap with great autorouting for cyclists, hikers and Mountainbikers at http://openmtbmap.org
  #10  
Old Jul 27, 2018, 01:40 PM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
If you ssend me PM with an admin ID/PW I'll poke about a bit. I might get a chance tomorrow morning before everyone gets up (I hope)
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
child theme for Atahualpa mgseven Atahualpa 3 Wordpress theme 7 Apr 16, 2013 10:52 AM
child theme problem twinisles New Versions, & Updating 3 May 16, 2012 01:55 PM
eCommerce child theme for Atahualpa thecartpress eCommerce & Atahualpa 1 Mar 27, 2012 10:56 AM


All times are GMT -6. The time now is 02:19 AM.


Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.