I copy this files to child theme – archive.php, index.php and tag.php. I set ‘columns’ => 4.
Is there any other solution, to make the same thing only from child function.php? To add some filter, function etc?
It will be useful for better updating the theme.
Thanks
Hey Martin,
If there are no filters around, this is the only way. Which lines are you looking at?
Best regards,
Victoria
can you try this – don’t know if this is the correct way to use this filter but it might work in combination with blog-grid style
just check for context: archive , index, tag
add_filter('avf_post_slider_args', function($atts, $context){
global $posts;
if($context == 'index') { $atts['columns'] = 4;}
return $atts;
}, 10, 2);
It works! Thanks a lot!
Is this correct?
add_filter('avf_post_slider_args', function($atts, $context){
global $posts;
if($context == 'index' || $context == 'archive' || $context == 'tag') { $atts['columns'] = 4;}
return $atts;
}, 10, 2);
Yes the pipe will have the “or” in the if clause.
That will work! – i’m only unsure if i had to insert that global $posts and if there is a more elegant way for the syntax.
It works without “global $posts;” :)
add_filter('avf_post_slider_args', function($atts, $context){
if($context == 'index' || $context == 'archive' || $context == 'tag') { $atts['columns'] = 4;}
return $atts;
}, 10, 2);
Thanks
Such a question is exactly the reason why I am also happy to answer questions here as a fellow participant. It is a challenge and i will learn the most from it. If a customer shows up and expresses exactly such a wish, I don’t stand there and won’t know what to say.
So thank you from my point of view, too.
Hi,
Thanks for helping out as always @guenni007, it’s very much appreciated :-)
Best regards,
Rikard