Forum Replies Created
-
AuthorPosts
-
I understand that. The question was if we would just have to load menu.js in the child theme if in the parent theme were no !important-rules?
On my end it worked with the pictures too but content in the color sections lost its custom styling. After I changed to ava_builder_shortcode_files_loaded it was as shown in your example. At first I thought it was a problem with the older template files, thats why I made your changes in the 4.9 files again, but the problem was still there. So you still loaded the /shortcodes folder with the code form the documentation?
add_filter('avia_load_shortcodes', 'avia_include_shortcode_template', 15, 1); function avia_include_shortcode_template($paths) { $template_url = get_stylesheet_directory(); array_unshift($paths, $template_url.'/shortcodes/'); return $paths; }
If the “!important” was omitted in parent theme it would be sufficient to only load the menu.js in the child theme, correct?
Thought so too but I tested it with your code and the files did not load correctly …
Hey Guenni, since Enfold changed parts of the shortcode behaviour in Version 4.8.9 I changed your filter from this post to:
add_filter('ava_builder_shortcode_files_loaded', 'avia_include_shortcode_template', 15, 1); function avia_include_shortcode_template($paths){ $template_url = get_stylesheet_directory(); array_unshift($paths, $template_url.'/shortcodes/'); return $paths; }
I added your modifications to the latest theme files (Version 4.9) and it works as expected.
If anyone wants to do the same just remember the correct filter.
-
This reply was modified 3 years, 4 months ago by
spooniverse.
Hey Guenni, since Enfold changed parts of the shortcode behaviour in Version 4.8.9 I changed your filter from this post to:
add_filter('<strong>ava_builder_shortcode_files_loaded</strong>', 'avia_include_shortcode_template', 15, 1); function avia_include_shortcode_template($paths){ $template_url = get_stylesheet_directory(); array_unshift($paths, $template_url.'/shortcodes/'); return $paths; }
I added your modifications to the latest theme files (Version 4.9) and it works as expected.
If anyone wants to do the same just remember the correct filter.
And for replacing this if-condition it is necessary to do all the stuff mentioned in the other entry?
Nice, Ismael, thank you! Now I have:
function avia_masonry_custom_query( $query ) { unset($query['post_type']['slug']); // Exludes Custom Post Type by slug $exclude_cat = array('category__not_in' => array( 1 )); // Excludes category by ID $query = array_merge((array)$exclude_cat, (array)$query); return $query; } add_filter('avia_masonry_entries_query', 'avia_masonry_custom_query');
That works as expected. You may close this thread as resolved.
-
This reply was modified 3 years, 4 months ago by
spooniverse.
Bessere Lösung als mit dem Script. Danke dir!
Hey MIke,
I know that the class is only added if the option is enabled. But as mentioned above (and written in the theme backend) the class it is missing from mobile – but I need it there. Thanks for spotting the mistake in the code snippet. It is working now, the class is added on mobile too.
Best regards,
DanielHey Ismael,
now I have written to filters:
function avia_masonry_custom_cat_query( $query ) { $exclude_cat = array('category__not_in' => array( 1 )); $query = array_merge((array)$exclude_cat, (array)$query); return $query; } add_filter('avia_masonry_entries_query', 'avia_masonry_custom_cat_query'); function avia_masonry_custom_tax_query( $query ) { $query['tax_query'][] = array( 'taxonomy' => 'kanal_zuordnung', 'field' => 'id', 'terms' => array('30', '31'), 'operator' => 'NOT IN' ); return $query; } add_filter('avia_masonry_entries_query', 'avia_masonry_custom_tax_query');
The Category and Taxonomy Terms are now excluded. Works fine. Two questions:
• Can I somehow exclude the complete Custom Post Type or do I have to define the Terms that should be excluded from masonries (like in the code above)?
• Can I combine the two filters into one?Best regards,
DanielI found a script like this in the forum, but it is not working on mobile:
function add_custom_script(){ ?> <script> (function($){ $(window).scroll(function() { var scroll = $(window).scrollTop(); if (scroll >= 50) { $("#header").addClass("header-scrolled"); } else { $("#header").removeClass("header-scrolled"); } })(jQuery); </script> <?php } add_action('wp_footer', 'add_custom_script');
Any other idea why I can’t finde the class on mobile? I know that the settings say that this option “is ignored on smartphones”, but it would be nice to have the class for styling purposes.
Sorry, but I think of one additional question while working with a transparent header: Why is “.header_scrolled” missing on mobile? I made the header sticky. Works well. It is transparent and if I scroll down it gets a white background. But on the larger sizes the class “.header_scrolled” is added and I can use it for additional styling. Any ideas why the class is missing and how I can get it back an small screen sizes?
Now I understand the difference. I think the description in the documentation should be clearer. The code there applies only to new pages (but the setting is changeable later).
Thanks again! Thread may be closed.
Hey Guenni007, thanks for your reply.
The code is from the documentation. I want the header transparent on all pages. So you think the filter needs to bee added too? Like that:
add_action( 'after_setup_theme', 'enfold_customization_product_switch' ); function enfold_customization_product_switch(){ add_filter('avf_builder_elements', 'avf_builder_elements_mod'); } function avf_builder_elements_mod($elements) { $counter = 0; foreach($elements as $element) { if($element['id'] == 'header_transparency') { $elements[$counter]['std'] = 'header_transparent'; } $counter++; } return $elements; } add_filter('avf_header_setting_filter', function($header) { $header['header_transparency'] = 'header_transparency'; $header['header_class'] .= " av_header_transparency"; return $header; }, 10, 1);
Or is your snippet working without the longer code from the documentation?
Hi Ismael,
that is correct but I want to mix (standard) categories and taxonomy entries. How can I do that? Something like that is not working:
function avia_masonry_custom_query( $query ) { $args = array( 'meta_query' => array( 'relation' => 'OR', array( 'post_type' => 'kanal', 'taxonomy' => 'kanal_zuordnung', 'field' => 'id', 'terms' => array('30', '31'), 'operator' => 'NOT IN' ), array( 'post_type' => 'post', 'category__not_in' => '1', ), ), ); $query = array_merge((array)$args, (array)$query); return $query; } add_filter('avia_masonry_entries_query', 'avia_masonry_custom_query');
In the end I could even exclude the whole Custom Post Type, that would be okay. So if I could exclude a certain (standard) category and a certain CPT everything should be fine. Do you have a code snippet for me?
Best regards,
DanielThanks for helping me out, Ismael. You may close this.
Found the place. I added the excerpt there alyready like:
'contents' => 'excerpt_read_more',
How do I add the preview_mode? Like that:
'preview_mode' => 'featured_large',
Or do I miss something?
Hey Ismael, thank you for your information. Will try some things with the header image.
Now back to the archive page image size:
You write you can adjust the thumbnail size in the archive pages by editing the archive.php file directly. I already searched for a function loading the
portfolio
size but did not find it. Where do I find the line to change? The filter you sent is for functions.php but I would like to change the size in the archive.php directly and don’t now where exactly.Thanks for helping me out!
That sounds interesting, Guenni007. Will try that for sure. In an other thread I read an alternative soloution for my atempt. One of them will work for sure. Thanks!
Und viele Grüße nach Bonn.
Thank you. Tweaked the code to my needs. You may close this.
Nice, Yigit, thanks! Did not find this snippet. Works in the way I would like to have it, but I do have two more questions:
• Is it possible to load a term of a custom taxonomy related to the post with this code? What parts should I alter?
• If I add exactly your code to Child Theme functions.php the author gets displayed but the date is missing. Any idea how to show date AND an other term (of a custom taxonomy)?Best regards
You may close this.
And thanks again to Guenni007Thank you! Works as aspected. Learnt a lot from your code.
Dear @guenni007, last question: Do you think it is possible to load the script only for a certain viewport? Let’s say on mobile I would use a normal link (open the entry) and from tablet-size on I would load the script and use the added lightbox. Any ideas?
Why? What is your preference?
Wow! That is beyond my expectations. Thank you!
Should be everything I need. Thread may be closed.
Perfect! Thanks a lot, Guenni007!
Any idea on how to hide the head and footer on those posts? In my case it is a custom post type. Should be possible with a modification to the single.php file of the CPT – what do you think?
Even better would be a script to hide head and footer only if the entry is shown inside an iframe? Do you think that is possible?
Best regards,
DanielThis is the way I would like to have it, yes! But with normal posts (not portfolio entries). And for some reason I would like to use the blog post element (not a masonry). Or can’t it be made with the blog post element?
Thank you for your effort already!
Hey Guenni007,
it is not about the normal blog. I would like to use a ALB blog post element (as in your first link) and display posts of a certain category on a page with the option “blog grid”. If the image or title of the shown entries is clicked the posts should be loaded as iframe in a lightbox, correct. Any ideas?
Thank you for your interest! And thanks Ismael for pointing out that it can be made somehow.
All the best,
DanielSuper fast implementation! I am thrilled. I just installed the new update and deleted my customization before. Runs perfectly as expected. Thanks for the fast support. And an even bigger thank you for the fact that you have already implemented another feature request from me as fast as lightning. You guys are the best.
In this sense I wish you Merry Christmas and see you soon! Feel free to close this thread.
Many greetings,
Daniel -
This reply was modified 3 years, 4 months ago by
-
AuthorPosts