Modify footer with css
-
Hi!
I created a child theme and managed to link my css file and all the modification works on the body section but not in the footer.
How can i link a css file so that i can modify the footer?
What i’m trying to achieve is a sitemap at the bottom of the webpage like on that page:https://public-media.interaction-design.org/images/uploads/af761d3f0bc5f3d5b8520b399c6820ac.jpg
- This topic was modified 4 years, 5 months ago by mrcdescollines.
- This topic was modified 4 years, 5 months ago by mrcdescollines.
- This topic was modified 4 years, 5 months ago by mrcdescollines.
-
Add classes to your HTML elements in the footer, and use the existing css for footer as well. Let me know if it resolves
In my footer.php i already have classes and id for my elements. For the existing css for the footer, do you mean my css file that i created? Or the one wich is created by WordPress?
my script for my css is in the function.php. I did an enqueue.
Here’s my code :<?php // Exit if accessed directly if ( !defined( 'ABSPATH' ) ) exit; // BEGIN ENQUEUE PARENT ACTION // AUTO GENERATED - Do not modify or remove comment markers above or below: if ( !function_exists( 'chld_thm_cfg_locale_css' ) ): function chld_thm_cfg_locale_css( $uri ){ if ( empty( $uri ) && is_rtl() && file_exists( get_template_directory() . '/rtl.css' ) ) $uri = get_template_directory_uri() . '/rtl.css'; return $uri; } endif; add_filter( 'locale_stylesheet_uri', 'chld_thm_cfg_locale_css' ); if ( !function_exists( 'chld_thm_cfg_parent_css' ) ): function chld_thm_cfg_parent_css() { wp_enqueue_style( 'chld_thm_cfg_parent', trailingslashit( get_template_directory_uri() ) . 'style.css', array( ) ); } endif; add_action( 'wp_enqueue_scripts', 'chld_thm_cfg_parent_css', 10 ); // END ENQUEUE PARENT ACTION add_action( 'wp_enqueue_scripts', 'my_theme_enqueue_styles' ); function my_theme_enqueue_styles() { $parent_style = 'parent-style'; wp_enqueue_style( $parent_style, get_template_directory_uri() . '/style.css' ); wp_enqueue_style( 'child-style', get_stylesheet_directory_uri() . '/css/test.css', array( $parent_style ), wp_get_theme()->get('Version') ); }
When you are talking about using the existing css, is it on the folder css that i created? Or on the root of the child folder wich WordPress created?
I’ll get it checked with my Developer and get back with the answer
Hi @mrcdescollines & @thealanmat ,
I’m a bit confused why you need to link an external CSS file into the footer area of your page. Adding external CSS via
link rel
anywhere in your page other than the<head></head
> tags is *not* good practice.Footers like the screen grab you supplied need to be built with a combination of HTML and CSS. We’d need to see your code to figure out what you’re trying to do and what the real issue is.
If you need help with this, I suggest sharing the link to the page in question. Otherwise, we will all be wasting your time taking more wild guesses.
More on that topic.
Thanks!
Hi everyone and thank you for you support.
Finaly, iv’e been able to solve my problem.
My css file worked on my footer section of the page. I just tought it didn’t work.
I did an enqueue on my css in my function.php like mentionned before.
I did some troubleshooting with someone and i cleared the cache and did a slight modification on an element and everything worked!- This reply was modified 4 years, 5 months ago by mrcdescollines.
- The topic ‘Modify footer with css’ is closed to new replies.