-
Search Results
-
I am trying to exclude posts (woocommerce products) which have a specific category (id=340) from the ‘avia_ajax_search’ popup.
have copied the function if(!function_exists(‘avia_ajax_search’))from /enfold/functions-enfold.php to /enfold-child/functions.php
Is this correct, or do i need a seperate /enfold-child/functions-enfold.phpif(!function_exists('avia_ajax_search')) { //now hook into wordpress ajax function to catch any ajax requests add_action( 'wp_ajax_avia_ajax_search', 'avia_ajax_search' ); add_action( 'wp_ajax_nopriv_avia_ajax_search', 'avia_ajax_search' ); function avia_ajax_search() { global $avia_config; $exclude_category_id = 340; // Replace with the actual category ID unset($_REQUEST['action']); if(empty($_REQUEST['s'])) $_REQUEST['s'] = array_shift(array_values($_REQUEST)); if(empty($_REQUEST['s'])) die(); $defaults = array('numberposts' => 5, 'post_type' => 'any', 'post_status' => 'publish', 'post_password' => '', 'suppress_filters' => false, 'results_hide_fields' => ''); $_REQUEST['s'] = apply_filters( 'get_search_query', $_REQUEST['s']); $search_parameters = array_merge($defaults, $_REQUEST); if ( $search_parameters['results_hide_fields'] !== '' ) { $search_parameters['results_hide_fields'] = explode(',', $_REQUEST['results_hide_fields']); } else { $search_parameters['results_hide_fields'] = array(); } $search_query = apply_filters('avf_ajax_search_query', http_build_query($search_parameters)); $query_function = apply_filters('avf_ajax_search_function', 'get_posts', $search_query, $search_parameters, $defaults); $posts = (($query_function == 'get_posts') || !function_exists($query_function)) ? get_posts($search_query) : $query_function($search_query, $search_parameters, $defaults); $search_messages = array( 'no_criteria_matched' => __("Sorry, no posts matched your criteria", 'avia_framework'), 'another_search_term' => __("Please try another search term", 'avia_framework'), 'time_format' => get_option('date_format'), 'all_results_query' => http_build_query($_REQUEST), 'all_results_link' => home_url('?' . http_build_query($_REQUEST)), 'view_all_results' => __('View all results','avia_framework') ); $search_messages = apply_filters('avf_ajax_search_messages', $search_messages, $search_query); if(empty($posts)) { $output = "<span class='av_ajax_search_entry ajax_not_found'>"; $output .= "<span class='av_ajax_search_image ".av_icon_string('info')."'>"; $output .= "</span>"; $output .= "<span class='av_ajax_search_content'>"; $output .= " <span class='av_ajax_search_title'>"; $output .= $search_messages['no_criteria_matched']; $output .= " </span>"; $output .= " <span class='ajax_search_excerpt'>"; $output .= $search_messages['another_search_term']; $output .= " </span>"; $output .= "</span>"; $output .= "</span>"; echo $output; die(); } //if we got posts resort them by post type $output = ""; $sorted = array(); $post_type_obj = array(); foreach($posts as $post) { $sorted[$post->post_type][] = $post; if(empty($post_type_obj[$post->post_type])) { $post_type_obj[$post->post_type] = get_post_type_object($post->post_type); } } //now we got everything we need to preapre the output foreach($sorted as $key => $post_type) { // check if post titles are in the hidden fields list if ( ! in_array('post_titles', $search_parameters['results_hide_fields'] ) ) { if(isset($post_type_obj[$key]->labels->name)) { $label = apply_filters('avf_ajax_search_label_names', $post_type_obj[$key]->labels->name); $output .= "<h4>".$label."</h4>"; } else { $output .= "<hr />"; } } foreach($post_type as $post) { $image = ""; $extra_class = ""; // Get the categories for the post $post_categories = wp_get_post_categories($post->ID); // Check if the excluded category is in the post categories if (!in_array($exclude_category_id, $post_categories)) { // check if image is in the hidden fields list if (!in_array('image', $search_parameters['results_hide_fields'])) { $image = get_the_post_thumbnail($post->ID, 'thumbnail'); $extra_class = $image ? "with_image" : ""; $post_type = $image ? "" : get_post_format($post->ID) != "" ? get_post_format($post->ID) : "standard"; $iconfont = $image ? "" : av_icon_string($post_type); } $excerpt = ""; // check if post meta fields are in the hidden fields list if ( ! in_array('meta', $search_parameters['results_hide_fields'] ) ) { if(!empty($post->post_excerpt)) { $excerpt = apply_filters( 'avf_ajax_search_excerpt', avia_backend_truncate($post->post_excerpt,70," ","...", true, '', true) ); } else { $excerpt = apply_filters( 'avf_ajax_search_no_excerpt', get_the_time( $search_messages['time_format'], $post->ID ), $post ); } } $link = apply_filters('av_custom_url', get_permalink($post->ID), $post); $output .= "<a class ='av_ajax_search_entry {$extra_class}' href='".$link."'>"; if ($image !== "" || $iconfont) { $output .= "<span class='av_ajax_search_image' {$iconfont}>"; $output .= $image; $output .= "</span>"; } $output .= "<span class='av_ajax_search_content'>"; $output .= " <span class='av_ajax_search_title'>"; $output .= get_the_title($post->ID); $output .= " </span>"; if ($excerpt !== '') { $output .= " <span class='ajax_search_excerpt'>"; $output .= $excerpt; $output .= " </span>"; } } $output .= "</span>"; $output .= "</a>"; } } $output .= "<a class='av_ajax_search_entry av_ajax_search_entry_view_all' href='".$search_messages['all_results_link']."'>".$search_messages['view_all_results']."</a>"; echo $output; die(); } }Hi.
What do I have to set so that the video is also displayed as a thumbnail in the blog. Is there a possibility? Or do I need a plugin? If so, which?
Thanks in advance.
NadjaHelp!
I have forgotten what I once did several times.
I need to have a different category banner and Category Image.
To See my problem go to https://www.pixelcomputer.de/shop/
If you click on a category like Workstations, Laptops or Phase One – A new page is opened and I see a category banner which is different from the overview thumbnail. This is fine and I want this behavior everywhere.
But I have forgotten how to achieve this. Like I added a new category in Laptops. If you go here
https://www.pixelcomputer.de/produkt-kategorie/laptops/You see Laptops Auslaufmodelle 2022/2023 if you click on this, you see a scaled image of the thumbnail. And I don’t find the way to define a banner image different from the thumbnail image.
I gooled and found that there should be an Option in Edit Categories to define a banner, but its not there:
Navigate to Dashboard > Posts > Categories and edit the category. You’ll see the image upload option for the banner there. I only see one for the image but not for the banner.
In another post I found that I should go to Enfold, Theme Options and Shop Options to Enable the Category Banner there but I have no option there.Please help!
Topic: display problems
Good morning,
I have many pages that have a display issue in the section: other available finishes.
I know that by performing an F5 refresh, the problem is immediately resolved, but my users don’t know how to view the thumbnails.
To update the page, they need to scroll to the end and then return to where they started.
I am attaching a video to better explain the problem:
Thank you.
Best regards,
Tiziano MolettaHi there ,
I am using the “Masonry” element on my website with the “Perfect Manual Masonry” setting.
Alos I use the tag “portrait” to display thumbnails of individual posts in Masonry in high format.
My site is multilingual (German-English). The tag “portrait” works for the German version of the corresponding page, but unfortunately NOT for the English version.Thanks a lot for your efforts in advance!
MarcHi,
We’re having difficulty getting a YouTube video to embed, both as a color section background video, and using the Video element in the Media tab.
The video background doesn’t play, and the video element has a black thumbnail and opens the YouTube video in a new tab when clicked.
The WP version is: 6.2.2
The Enfold parent theme version is: 5.6.3Thank you for your time!
HarryI’m a little confused by thumbnail sizes.
I see the “MEDIA SETTINGS” in the Settings tab of WordPress, which allows me to set a maximum size for Thumbnail, Medium, and Large size images that are to be generated every time I upload an image.However, I believe Enfold generates these images at many different sizes when I upload them. So do I ignore this menu entirely?
I’m trying to get my thumbnails in my Portfolio Grid to be exactly the size they need to be to compress them so they load faster.
When looking through the Portfolio Grid image size options, there really isn’t anything with a 4:5 ratio (which is a very common ratio – social media posts use this). In fact, there aren’t many Portrait ratio options at all – most are square, or landscape.
So I’ve just been leaving it on “No Scaling” – but that option isn’t great, because I’d like it to crop a Landscape Ratio thumbnail to a 4:5 Portrait.
Please adviseI have a question that I’m not sure how to explain:
I use the Ajax Portfolio – so most of my Portfolio Item post info shows up as a Preview when the user clicks a thumbnail.
Are Portfolio Item posts crawled by search engines, or do I need to also make the content as a regular Post as well?
I want the content in my Portfolio Item posts (such as the images, and the description text describing the images) to be crawled by Google (for example) and show up in search results.I wasn’t sure if these posts are “visible” to search engines, since the website is mainly serving up previews of these posts.
Am I making sense? (probably not).Topic: Masonry Ajax Portfolio
I would really like to have the Ajax Portfolio be available with a Masonry grid option for the thumbnails.
Is there a way to do this?
I have asked some designers on Codeable for a quote on doing this for me (it’s fairly expensive) – but I’m not clear if they totally understand what I”m asking for.
Is there some kind of technical reason that Masonry is NOT offered with the Ajax Portfolio? Something that would prevent us from doing this custom?Topic: YouTube Video is not playing
Dear Support Team,
I have updated enfold to the latest version running on WP 6.2.2. I have used the Video element with a URL to a video on YouTube video displaying the Video Thumbnail but the video does not run at all.
I appreciate your assistance
Best








