tomdiv
Forum Replies Created
-
Forum: Plugins
In reply to: [Smart Slider 3] size problem in ChromeActually setting the width does indeed work however I wanted to have it be responsive and scale down. I will just have to write some more rules for smaller widths. But the major problem is solved, thank you for that, I appreciate the support even for the free version.
I thought that’s what controls in the SmartSlider setting did, there are a lot of options regarding max width it would be good to be able to control min width maybe.
Forum: Plugins
In reply to: [Smart Slider 3] size problem in ChromeWell as I mentioned it works fine in Firefox but not Chrome. and so far I have no CSS that targets either one different.
I will try using a stated width. It does look like it has something to do with using flexbox and align-content:center that is causing the problem in chrome only.Forum: Developing with WordPress
In reply to: enqueue child theme CSS lastOK!
Forum: Developing with WordPress
In reply to: enqueue child theme CSS lastWell thanks for helping to learn about the array (arguement? would that be the correct term?) I took that part out because I just want the child style sheet to load last, even after other plugs-in styles that I have not even installed yet. This way I don’t have to go back and (possibly have to) change it everytime I install a plug-in.
Here is the full code in case anyone else stumbles upon this with the same question
function test_dequeue_styles() { // this removes the original style wp_dequeue_style( 'start-style' ); wp_deregister_style( 'start-style' ); } add_action( 'wp_enqueue_scripts', 'test_dequeue_styles', 20 ); function test_enqueue_styles() { // parent style ( this loads the css from the main folder ) wp_enqueue_style( 'start-parent-style', get_template_directory_uri() .'/style.css' ); } add_action( 'wp_enqueue_scripts', 'test_enqueue_styles' ); function new_enqueue_styles() { // child style ( this loads the css from the child folder after parent-style ) wp_enqueue_style( 'start-child-style', get_stylesheet_directory_uri() .'/style.css' ); } add_action( 'wp_enqueue_scripts', 'new_enqueue_styles', 999 );
I noticed if I don’t use 20 as priority for de-enqueing then I end up with the child sheet being loaded twice, but with different IDs.
One key to it all was that I just had to re-enqueue the parent and child style using two different functions and action hooks rather than trying to do it with one function, so I could set a different priority
I really did learn a lot from your help, thank you very much. Will leave this question open for just a little bit longer in case there are any other comments.
Forum: Developing with WordPress
In reply to: enqueue child theme CSS lastWell I am getting close, I have to play with it a bit more. I still want the parent-style to load as the theme author intended it (before bootstrap and 2 js scripts} and have the child style sheet load last after everything. I believe I can figure it out with the info so far.
One trick I have waiting to use is that in other forums (i have researched this a lot) some peoples questions were solved by setting the priority to 999 [a really high number that is probably higher than any other priorities that have been set]; and then in another forum it was said that better to use PHP_INT_MAX
I noticed in your code you de-enqueued and de-registered the styles, and then enqueued them but I don’t see them being registered. But i don’t want to derail this by talking about registering that would be another topic.
Forum: Developing with WordPress
In reply to: enqueue child theme CSS lastYes you have really explained it well, I still have to absorb understanding things like sometimes the reference is “start-style” and sometimes the reference is “start-parent-style” and “start-child-style”. The latter are clear what it means but “start-style” isn’t always clear (to me) which one is being referred to. But I think I will be able to go play with it and make it work.
- This reply was modified 7 years, 4 months ago by tomdiv.
Forum: Developing with WordPress
In reply to: enqueue child theme CSS lastWell i think with your help I’ve answered my own question.
I removed all the code from the child theme functions.php
Now only the child theme stylesheet is being loaded.
so therefore, by choosing the child-theme as the theme, wordpress loads (enqueues?) the child theme style sheet.
But the code added to functions.php (in the child folder) is what enqueues the parent style (sheet).So in order to get the child theme style sheet to truly load last, I am going to have to de-enqueue it and the re-enqueue it in functions.php; i was seeing if it was possible to get around that by merely not enqueing it in the first place but wordpress is already doing that. So i have to figure out how wordpress is enqueing it to de-enqueue it? (what exactly it is calling it and what priority does it have?). As oppossed to the parent theme css, which I am actually the one enqueing it when i put the code in myself (sort of like step 3 when creating a child theme)
One thing that is confusing is the source code that is written when WP enqueues the child style sheet is
<link rel='stylesheet' id='start-style-css' href='https://vdl-local/wp-content/themes/start-child/style.css?ver=4.8' type='text/css' media='all' />
and it’s giving it the id start-style-css when it is actually the start-CHILD-style-css, little things like that make it harder to learn all these concepts.
edit- oh darn it took me so long to write this you had replied again, i haven’t read your last post yet
- This reply was modified 7 years, 4 months ago by tomdiv.
Forum: Developing with WordPress
In reply to: enqueue child theme CSS lastWell you really helped me out by clearing up this for me
get_template_directory_uri() , this equals the parent folder
and get_stylesheet_directory_uri() this would equal the child folder.
That explains a lot of things for me, I suspected as much but hadn’t truly tested and figured out that concept.
But that being considered, if you look at my original question, the code I posted is the ONLY thing added (in my child theme functions.php),
it doesn’t reference the child theme, or the child-style, or get_stylesheet_directory_uri()
Yet the child theme css is also being loaded. So is there something in wordpress core that recognizes wp_enqueue_style( ‘parent-style’…
and then causes the the child theme style sheet to be loaded?(Oh, and the theme Start is a very simple starter thing to help learn to develop themes, etc. So I had to create my own child theme and it is not “bundled” or rely on plug-ins etc. )
- This reply was modified 7 years, 4 months ago by tomdiv.