Timeline for different tag different stylesheet
Current License: CC BY-SA 3.0
21 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jan 16, 2017 at 11:16 | comment | added | bets | sorry for my late answer, yes i did put the tag on the post :) | |
Jan 10, 2017 at 11:42 | comment | added | Magnus Guyra | Have you put a tag on the post? | |
Jan 9, 2017 at 11:29 | comment | added | bets | I think that i do the loading thing not correct, because the code (<link rel='stylesheet' href='/wp-content/themes/customizr-child/css/circulair.css' type='text/css'>)don't show up | |
Jan 6, 2017 at 8:31 | comment | added | Magnus Guyra | The only code that should show is the <link rel='stylesheet' href='/wp-content/themes/customizr-child/css/circulair.css' type='text/css'>, and only if the post has been tagged with "circulair". The rest of the code will not show when viewing the source. | |
Jan 5, 2017 at 11:56 | comment | added | bets | okee i changed that and i put everything after the last line but before the </header> and it seems, when i look at the page source there is no code.... so i think there is nothing been load | |
Jan 5, 2017 at 10:46 | comment | added | Magnus Guyra | Ah, you don't need to add the full path, yourself. It automatically finds it through "get_stylesheet_directory()". :) It should go in your header.php file. It won't work in functions.php because it's not a function. | |
Jan 5, 2017 at 9:57 | comment | added | bets | first in the header and i tried it in the function.php i tried the full path ..../wp-content/themes/customizr-child//css/circulair.css" | |
Jan 5, 2017 at 9:38 | comment | added | Magnus Guyra | No problems. Where are you adding the code? | |
Jan 5, 2017 at 9:27 | comment | added | bets | hee Magnus i tested it but it won't work unfortunately. i tried several times, when the site is loading it takes a while when showing up, sorry thanks for your patience | |
Jan 4, 2017 at 7:38 | comment | added | Magnus Guyra | Yeah, my bad! I forgot to specify that we wanted the name of the tag ($t->name), and shouldn't have used the $count variable for the "if()". It works now. I've tested it. :) | |
Jan 4, 2017 at 7:36 | history | edited | Magnus Guyra | CC BY-SA 3.0 |
Fixed the code. Works now. Tested.
|
Jan 3, 2017 at 18:55 | comment | added | bets | sorry it won't work Magnus i get a error Warning: Invalid argument supplied for foreach() in /header.php on line 60 | |
Jan 3, 2017 at 14:48 | comment | added | Magnus Guyra | Keep in mind, this will try to locate and load multiple CSS files if you have multiple tags on your post. Which may or may not be what you want. (For example, if you have both one set of stylesheets for shapes and another set for colours.) | |
Jan 3, 2017 at 14:46 | comment | added | Magnus Guyra | Edited my answer with the full(but untested) code. :) | |
Jan 3, 2017 at 14:44 | history | edited | Magnus Guyra | CC BY-SA 3.0 |
added 1004 characters in body
|
Jan 3, 2017 at 14:19 | comment | added | bets | This seems very simple Magnus do i write that code in function? and how do i write that? | |
Jan 3, 2017 at 12:27 | comment | added | Magnus Guyra | Using the second solution in my answer, you wouldn't need to do much manually. Basically: get tagname -> find tagname.css -> if exist, load / else load standard.css | |
Jan 3, 2017 at 11:07 | comment | added | bets | You right, is't not to big but it is to complicated because i have to do that for every tag that needs a different styleheet isn't it? And when i use php in the function, than it's easier. But i don't know how :) | |
Jan 3, 2017 at 10:57 | comment | added | Magnus Guyra | Why is it too big to load in the header? | |
Jan 3, 2017 at 10:56 | comment | added | bets | Thanks, but the css file is to big to load in the header | |
Jan 3, 2017 at 10:53 | history | answered | Magnus Guyra | CC BY-SA 3.0 |