Support Forum

Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
general-topic
Avatars in topic view
Avatar
Ike
Sawtry, UK
Member
Free Members
sp_UserOfflineSmall Offline
Oct 23, 2015 - 8:34 am

It's definitely what it sounds like..

Maybe you could zip up the child theme and email it to me at ike@simple-press.com and I can check it to see what's going on. Make sure to leave the CSS that isn't working in place..

Avatar
Alex T
Member
sp_UserOfflineSmall Offline
Oct 23, 2015 - 9:56 am

Ike said
It's definitely what it sounds like..

Maybe you could zip up the child theme and email it to me at ike@simple-press.com and I can check it to see what's going on. Make sure to leave the CSS that isn't working in place..

OK, just emailed you the zipped child theme.

Avatar
Ike
Sawtry, UK
Member
Free Members
sp_UserOfflineSmall Offline
Oct 23, 2015 - 10:06 am

Have received, will take a look shortly.

Avatar
Ike
Sawtry, UK
Member
Free Members
sp_UserOfflineSmall Offline
Oct 23, 2015 - 11:06 am

OK I think I understand what's going on.. This was the first CSS change you had to add to your child theme correct?

Your spTheme.txt is pointing to reboot-child.css as the child theme stylesheet - This is where you should put any CSS that you want to take precedence over the parent CSS. Remember that only changes need to be added, you don't need a copy of the entire stylesheet.

You shouldn't have reboot.php in the child theme at all, in any way. Just for a reference, if you want to be able to use php in your child themes stylesheet then you will need to change the extension of reboot-child.css to reboot-child.php and also update the change in spTheme.txt.

So to recap, you need to:

1. Delete reboot.php from your child themes styles folder

2. Add the following code to your reboot-child.css stylesheet

#spMainContainer .spTopicPostSection .spPostUserAvatar img {          width: 80px; }

3. Remove the above from your parent themes reboot.php file

And things should work just fine..

Avatar
Alex T
Member
sp_UserOfflineSmall Offline
Oct 23, 2015 - 11:42 am

Ike said
OK I think I understand what's going on.. This was the first CSS change you had to add to your child theme correct?

Your spTheme.txt is pointing to reboot-child.css as the child theme stylesheet - This is where you should put any CSS that you want to take precedence over the parent CSS. Remember that only changes need to be added, you don't need a copy of the entire stylesheet.

You shouldn't have reboot.php in the child theme at all, in any way. Just for a reference, if you want to be able to use php in your child themes stylesheet then you will need to change the extension of reboot-child.css to reboot-child.php and also update the change in spTheme.txt.

So to recap, you need to:

1. Delete reboot.php from your child themes styles folder

2. Add the following code to your reboot-child.css stylesheet

<br />

#spMainContainer .spTopicPostSection .spPostUserAvatar img {          width: 80px; }

<br />

3. Remove the above from your parent themes reboot.php file

And things should work just fine..

Wait, so if I want to make a change to something in sptopicview for instance, I don't have to copy the whole thing and add the new code?  I remember being told that I had to copy the whole thing, add the change and place it in the child for it to work.  

Avatar
Ike
Sawtry, UK
Member
Free Members
sp_UserOfflineSmall Offline
Oct 23, 2015 - 12:23 pm

No, if you want to make a change to a template you do need to copy the whole thing. If you had an empty template file with just your change / addition, the parent template wouldn't know where to put it.

CSS works differently. If you have a rule targeting an ID or a class that says 'color: red;' for example, then underneath have exactly the same rule with 'color: green;' then the element will take the last instance and will appear green. It's therefore possible to have only the rules you want to change in your child themes stylesheet as they will be loaded over the top of the corresponding rules in your parent stylesheet.

So, you need the whole template if you want to make changes, but you only need the CSS Rules you want to directly change in the stylesheet.

It might be worth you having another read of Creating a Child Theme. Heavy read or not, it has all the information in you need.

So, does it work?

Avatar
Alex T
Member
sp_UserOfflineSmall Offline
Oct 24, 2015 - 2:57 pm

Ike said
No, if you want to make a change to a template you do need to copy the whole thing. If you had an empty template file with just your change / addition, the parent template wouldn't know where to put it.

CSS works differently. If you have a rule targeting an ID or a class that says 'color: red;' for example, then underneath have exactly the same rule with 'color: green;' then the element will take the last instance and will appear green. It's therefore possible to have only the rules you want to change in your child themes stylesheet as they will be loaded over the top of the corresponding rules in your parent stylesheet.

So, you need the whole template if you want to make changes, but you only need the CSS Rules you want to directly change in the stylesheet.

It might be worth you having another read of Creating a Child Theme. Heavy read or not, it has all the information in you need.

So, does it work?

Sorry, this threw me off:

Ike said
OK I think I understand what’s going on.. This was the first CSS change you had to add to your child theme correct?

Anyway, I removed the reboot.php file from the child theme.  Removed the code from the parent reboot.php, and added the code 

#spMainContainer .spTopicPostSection .spPostUserAvatar img {          width: 75px; }

to the reboot-child.css from the theme editor:

 
Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Oct 24, 2015 - 3:07 pm

so, all set now?

Avatar
Alex T
Member
sp_UserOfflineSmall Offline
Oct 24, 2015 - 3:10 pm

I don't know what'g going on with the formatting.  It won't allow me to finish the paragraph without placing everything in the end in the css code.  It does not work if I follow the steps.  I placed the code using the theme editor and placed it in reboot-child.css

/* ================================================
This is the Reboot Child Theme CSS file
ONLY add the CSS rules that you need to override
the main rules form the parent Unified theme.
==================================================== */

#spMainContainer .spTopicPostSection .spPostUserAvatar img { width: 75px;

}

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Oct 24, 2015 - 3:47 pm

I have been trying to follow this thread but it does seem a little all over the place!

Anyway - please someone correct me if I am wrong - or of this has already been dealt with... - but... the call to spUserAvatar() contains an explicit size argument which is written out in the image tag as a 'max-width' style attribute. As this is inline in the image tag it will override any other width  styling that is applied to the avatar images in CSS which will be ignored - if the width is greater than that in the tag. So - the function will have to have that width set to the largest value required.

Further - a question I am unsure of the answer to but - if the CSS width rule is greater than the image it is being applied to can we expect the image to be scaled up?

andy-signature.png
YELLOW
SWORDFISH
Forum Timezone: Europe/Stockholm
Most Users Ever Online: 1170
Currently Online:
Guest(s) 1
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Mr Papa: 19448
Ike: 2086
Brandon: 864
kvr28: 804
jim: 650
FidoSysop: 577
Conrad_Farlow: 531
fiddlerman: 358
Stefano Prete: 325
Member Stats:
Guest Posters: 620
Members: 17365
Moderators: 0
Admins: 4
Forum Stats:
Groups: 7
Forums: 17
Topics: 10128
Posts: 79626