Forum Replies Created
-
AuthorPosts
-
hm – first get rid of that invisible hr – you can manage that in a different way.
Because all elements in a flex container will be handled and that is an additonal container.
This color-section should have only the columns in it.then – i do not see even the first rule to set the entry-content-wrapper to display:flex – so i guess you have not regenerated the mergied files of css and js.
i see on developer tools none of my code above – these are the old merged files:
This merging of the files behaves similar to caching – so goto your Enfold Child – Performance – and mark delete old css an js files – and save all changes.
After that delete the browser cache too!See what happens to the page if i (virtually) add the code to your page:
the two images are not set as the others to align: center – that makes a difference because these have other paddings !i deleted one thing ( all of your content is set to white color – so the one rule is obsolete) and i added only one rule to have more padding left right:
#outlines-flex .entry-content-wrapper { display: flex; flex-flow: row wrap; justify-content: center; overflow: hidden; align-items: stretch; } /*** otherwise these "containers" will influence the flexbox ***/ #outlines-flex .entry-content-wrapper::before, #outlines-flex .entry-content-wrapper::after { display: none; } #outlines-flex .entry-content-wrapper .flex_column { flex: 1 1 auto; outline: 1px solid #fff; padding: 90px 30px !important; margin: 0 ; } #outlines-flex .entry-content-wrapper .flex_column * { text-align: center !important; } @media only screen and (max-width: 989px) { #outlines-flex .entry-content-wrapper .flex_column { flex: 0 1 50%; outline: 1px solid #fff; padding: 90px 30px !important; margin: 0 !important } } @media only screen and (max-width: 549px) { #outlines-flex .entry-content-wrapper { justify-content: space-around; } #outlines-flex .entry-content-wrapper .flex_column { flex: 0 1 90%; outline: none !important; padding: 40px 30px !important; border: 1px solid #fff; margin-bottom: 20px !important } }
think of your merged files !
PS: Avoid uncommon signs in css f.e. that dashed line in your quick css ? – – – – – – – – – – on top – remove this too – if you want to have comments in css just surround it by /***** xyz ****/by the way if you do not like to have these arrays with a loto of lists:
this could be an interesting link for you : https://kriesi.at/support/topic/different-header-logo-for-different-sections-of-website/#post-1065071
that is for all suppages .
On Categories there are more condition tags to include whole sets : https://codex.wordpress.org/Conditional_Tags but see difference is_category() , has_category() and in_category()you first have to read carefully – i think all my tuts are good enough to reproduce.
first take the flexbox modell !
This is a mighty way to do this.
Then a lot of participants only put in the code and do not read about custom classes or ID’sthe setting was: all 8 1/4th columns in one colour section; this color-section got the ID : outlines-flex
the 1/4th columns are set to individual height and with no space between!Thats it: then try the code.: Link
March 15, 2020 at 9:15 pm in reply to: Masonry / portolio grid: How can I change the order of sort options (not abc)? #1193295on the other hand if the order option you need is a kind of system i use this in child-theme functions.php:
function avia_custom_query_extension($query, $params) { global $avia_config; if(!empty($avia_config['avia_custom_query_options']['order'])) { $query['order'] = $avia_config['avia_custom_query_options']['order']; } if(!empty($avia_config['avia_custom_query_options']['orderby'])) { $query['orderby'] = $avia_config['avia_custom_query_options']['orderby']; } unset($avia_config['avia_custom_query_options']); return $query; } add_filter('avia_masonry_entries_query', 'avia_custom_query_extension', 10, 2); add_filter('avia_post_grid_query', 'avia_custom_query_extension', 10, 2); add_filter('avia_post_slide_query', 'avia_custom_query_extension', 10, 2); add_filter('avia_blog_post_query', 'avia_custom_query_extension', 10, 2); add_filter('avf_magazine_entries_query', 'avia_custom_query_extension', 10, 2); add_filter('avf_template_builder_shortcode_elements','avia_custom_query_options', 10, 1); function avia_custom_query_options($elements) { $allowed_elements = array('av_blog','av_masonry_entries','av_postslider','av_portfolio','av_magazine'); if(isset($_POST['params']['allowed']) && in_array($_POST['params']['allowed'], $allowed_elements)) { $elements[] = array( "name" => __("Custom Query Orderby",'avia_framework' ), "desc" => __("Set a custom query orderby value",'avia_framework' ), "id" => "orderby", "type" => "select", "std" => "", "subtype" => array( __('Default Order', 'avia_framework' ) =>'', __('Title', 'avia_framework' ) =>'title', __('Random', 'avia_framework' ) =>'rand', __('Date', 'avia_framework' ) =>'date', __('Author', 'avia_framework' ) =>'author', __('Name (Post Slug)', 'avia_framework' ) =>'name', __('Modified', 'avia_framework' ) =>'modified', __('Comment Count', 'avia_framework' ) =>'comment_count', __('Page Order', 'avia_framework' ) =>'menu_order') ); $elements[] = array( "name" => __("Custom Query Order",'avia_framework' ), "desc" => __("Set a custom query order",'avia_framework' ), "id" => "order", "type" => "select", "std" => "", "subtype" => array( __('Default Order', 'avia_framework' ) =>'', __('Ascending Order', 'avia_framework' ) =>'ASC', __('Descending Order', 'avia_framework' ) =>'DESC')); } return $elements; } add_filter('avf_template_builder_shortcode_meta', 'avia_custom_query_add_query_params_to_config', 10, 4); function avia_custom_query_add_query_params_to_config($meta, $atts, $content, $shortcodename) { global $avia_config; if(empty($avia_config['avia_custom_query_options'])) $avia_config['avia_custom_query_options'] = array(); if(!empty($atts['order'])) { $avia_config['avia_custom_query_options']['order'] = $atts['order']; } if(!empty($atts['orderby'])) { $avia_config['avia_custom_query_options']['orderby'] = $atts['orderby']; } return $meta; }
it will add on each ALB which concerns to a sort option dialog.
March 15, 2020 at 9:13 pm in reply to: Masonry / portolio grid: How can I change the order of sort options (not abc)? #1193290i use – if there are not so many portoflio /post a plugin called Intuitive custom post order.
Günter told me that f.e. : https://de.wordpress.org/plugins/simple-custom-post-order/ this is a good alternative.
You can drag and drop on the post / portfolio list the entries to the place your need.This is not intended as a final solution, but as a bridge until there is a fix. In this case the child theme solution can then be quickly undone.
I have compared the files in both folders – with DiffMerge – there are no differences. Now to think about it: I replaced your enfold with mine via ftp. No Alt and Title attributes on the Alternate logo ?
So this is strange!
PS @peterolle : my manual input fields work ! Just paste the code to your child-theme functions.php
function my_transparent_logo_attributes( array $avia_elements = array() ) { $slug = "header"; $id = 'header_replacement_logo'; $new_element_1 = array( "slug" => "header", "name" => __( "Alt for the Transparency Logo", 'avia_framework' ), "desc" => __("Put in your Alt Attribute for Transparency Logo", 'avia_framework'), "id" => "header_replacement_logo_alt", "type" => "text", "std" => "" ); $new_element_2 = array( "slug" => "header", "name" => __( "Title for the Transparency Logo", 'avia_framework' ), "desc" => __("Put in your Title Attribute for Transparency Logo", 'avia_framework'), "id" => "header_replacement_logo_title", "type" => "text", "std" => "" ); $found = false; $index = 0; foreach( $avia_elements as $key => $element ){ $index++; if( isset( $element['id'] ) && ( $element['id'] == $id ) && isset( $element['slug'] ) && ( $element['slug'] == $slug ) ) { $found = true; break;} } if( ! $found ) { $avia_elements[] = $new_element_1 ; $avia_elements[] = $new_element_2 ; } else { $avia_elements = array_merge( array_slice( $avia_elements, 0, $index ), array( $new_element_1, $new_element_2 ), array_slice( $avia_elements, $index ) ); } return $avia_elements; } add_filter( 'avf_option_page_data_init', 'my_transparent_logo_attributes', 10, 1 );
Yes but – it is not quiet easy as i thought first:
if this is the setting: https://kriesi.at/support/topic/change-bacground-color-of-sidebar/#post-1192188
we have for the content: 1310px because of left right padding of 50px.
for the : template-page content it is : 956,3px (73% of 1310px)
and for aside : 353,7px (27% of 1310px) but this ends on the right side without padding – if you want to colorize it looks better if you do a “pseudo padding” more background as the width of it is f.e. the 50px
…hope you all will understand the calculations with the given comments:
/**** just for that example page ***** don't know why there is container set to 95% ***** so i first set it to 100% because it is better to understand ***** and 1410px with 50px padding left and right ***** so template width is 1310px - content is 73% of that - aside ist 27% ***** ****/ .container { width: 100% !important; } @media only screen and (min-width: 1410px) { .container_wrap.sidebar_right:not([style*="background-image"]):before { content: ''; display: block; position: absolute; left: calc(50vw + 0.23*1310px); top: 0; background: #ddd; height: 100%; width: calc(0.27*1310px + 50px); /** 27% of 1310px + 50px ** looks better **/ } } /** in case it should cover the whole background from aside start to screen width end @media only screen and (min-width: 1410px) { .container_wrap.sidebar_right:not([style*="background-image"]):before { content: ''; display: block; position: absolute; left: calc(50vw + 0.23*1310px); top: 0; background: #ddd; height: 100%; width: calc(50vw - 0.23*1310px); } } ***/ @media only screen and (max-width: 1409px) { .container_wrap.sidebar_right:not([style*="background-image"]):before { content: ''; display: block; position: absolute; right: 0 ; top: 0; background: #ddd; height: 100%; width: calc(0.27*(100vw - 100px) + 50px) } } @media only screen and (max-width: 767px) { .container_wrap.sidebar_right:not([style*="background-image"]):before { display: none } }
with an update the code is then no longer necessary – because enfold 4.7.3 already has these ID’s on the av-layout-tab
Tip: on using images as on my example footer – and with white or black symbols you can style the hover state with f.e. filter : hue-rotate:
#top #wrap_all .av-social-link-telegram:hover a { -webkit-filter: hue-rotate(180deg); filter: hue-rotate(180deg); }
flexbox modell – same example page – see the difference on responsive behavior: https://webers-testseite.de/griditems/
just have individual height here for 1/4th containers and no space between – the ID in this color-section is: outlines-flex#outlines-flex .entry-content-wrapper { display: flex; flex-flow: row wrap; justify-content: stretch; overflow: hidden; } /*** otherwise these "containers" will influence the flexbox ***/ #outlines-flex .entry-content-wrapper::before, #outlines-flex .entry-content-wrapper::after { display: none; } #outlines-flex .entry-content-wrapper .flex_column { flex: 1 1 auto; outline: 1px solid #fff; padding: 90px 0 !important; margin: 0 } /*** just forgotten to set the colors for the entries ***/ #outlines-flex .avia-animated-number * { color: #fff !important; } @media only screen and (max-width: 989px) { #outlines-flex .entry-content-wrapper .flex_column { flex: 0 1 50%; outline: 1px solid #fff; padding: 90px 0 !important; margin: 0 !important } } @media only screen and (max-width: 549px) { #outlines-flex .entry-content-wrapper { justify-content: space-around; } #outlines-flex .entry-content-wrapper .flex_column { flex: 0 1 90%; outline: none !important; padding: 90px 0 !important; border: 1px solid #fff; margin-bottom: 20px !important } }
Play a bit with your responsive break-points maybe it is necessary to adjust for your settings.
just create a color-section ( gave a custom-class or unique ID to it f.e.: outlines) – but in all 8 times your 1/4 columns
style them with outline not with borders !
the surrounding container got now the overflow:hidden – so in most cases the outlines at the border are gone – otherwise a negativ margin will to the trick.#outlines .flex_column { outline: 1px solid #fff; overflow: visible !important; padding: 90px 0 !important; } #outlines .entry-content-wrapper { overflow: hidden !important; }
see here: https://webers-testseite.de/griditems/
For the responsive case : do some css to hide – or switch then to bordersEdit : if you want it really perfect – just do it as in your example page and use flexbox modell to rule the outlook
.mfp-inline-holder .mfp-content, .mfp-ajax-holder .mfp-content { width:1000px; }
a bit offtopic but sometimes it is nice to use instead an image. You can use exactly the same code-snippet to register a new social share icon but with images ( png’s f.e.)
see documentation: https://kriesi.at/documentation/enfold/social-share-buttons/#gist85414748see here in my footer the usage of png file: https://webers-testseite.de/#footer
___________________________________
PS : entypo-fontello ( standard Enfold font icon set has that little paper-airplane too) :
function avia_add_custom_icon($icons) { $icons['telegram'] = array( 'font' =>'entypo-fontello', 'icon' => 'ue8b7'); return $icons; } add_filter('avf_default_icons','avia_add_custom_icon', 10, 1); function avia_add_custom_social_icon($icons) { $icons['Telegram'] = 'telegram'; return $icons; } add_filter('avf_social_icons_options','avia_add_custom_social_icon', 10, 1);
hm – on a fresh install i see now that the checkbox to deactivate the jqmigrate is missing?
OK – i see – it only is visible if plugins are installed.well i think it is because your av-layout-tab has only the data-tab-section-id – and maybe this i due to your Enfold Version 4.6.2
on 4.7.3 these av-layout-tab get the ID ( on your case nails)
You can do : update to newest version or put this to your child-theme functions.php:function tab_section_add_id(){ ?> <script> (function($){ $(window).load(function() { $('.av-layout-tab').each(function(){ var dataID = $(this).data('tab-section-id'); $(this).attr("id", dataID); }); }); })(jQuery); </script> <?php } add_action('wp_footer', 'tab_section_add_id');
it will do the job that 4.7.3 did allready.
i would advice you to update : see here some hints: https://kriesi.at/support/topic/some-hints-and-advice-to-update-enfold/#post-1056107Please Mike – do not think i have not tested even a pure virginal install – see login data for you in private Content.
https://webers-testseite.de/pureinstall/Even my standard security entries in htaccess file are missing here. Quick CSS only has one entry. child-theme functions.php is without active input – just comments as on child-theme download of enfold-docu site.
Maybe you are using a beta-version or 4.7.3.1 ;)
Tell me when you are ready to proove – because i want to make these htaccess entries as soon as possible
Edit: sorry couldn’t wait to insert some security positions in htaccess.i did it on a playgrond page of mine
everything – including code is there.Setting is that no past day can be selected. To-Day had to be after From-Day
https://webers-testseite.de/3columns/you can style the unselectable days with f.e.:
.ui-datepicker-unselectable.ui-state-disabled { opacity: 0.2; }
You mean a datepicker like from – to datepickers where the second datepicker can only choose dates after the first date set?
And even more – if you select the second one first, at most only this date can be selected before or even up to today in the first one.Eben weil es zuviele Webseiten Einstellungen jeder einzelnen Seite gibt, kann das Thema das nicht komplett leisten.
Siehe hier mein Kommentar: https://kriesi.at/support/topic/header-security-entries/#post-1153969
Mein Einwand war, auf einem Frischinstalliertem Enfold ohne Google Services etc. Ohne Plugins – wohl aber mit Inline ( child-theme functions.php) Scripten die Header set Content-Security-Policy Diese Scripte obwohl ja auch auf meinem https laufend blockiert.
???
_____________Precisely because there are too many web page settings of each page, the theme can’t do it entirely.
See here my comment: https://kriesi.at/support/topic/header-security-entries/#post-1153969
My objection was, that on a freshly installed Enfold without Google Services etc. Without plugins – but with Inline ( child-theme functions.php) scripts the Header set Content-Security-Policy blocks these inline scripts without the allowance to be unsafe-
This reply was modified 5 years, 3 months ago by
Guenni007.
maybe it has changed in the meanwhile – and uses now the srcset for those images too.
The flter allready exists and let you influence what generated image-size is used for those widget thumbnails.
You can style these images with css – but on former enfold versions ( it only resizes the 36px or 80px thumbnail ) there is always defined a thumnail size as source for those (featured)-images
I talk about the sidebar widget images. This filter can redefine the source for it.-
This reply was modified 5 years, 3 months ago by
Guenni007.
What does the code above do:
the register-admin-options.php rules the outlook of our enfold options page.
every tab has its own slug ( avia, layout, styling … header … etc.)
now the slug is searched (in this case: header) and it looks for a given ID – (in this case: header_replacement_logo)
if this is found the whole avia_elements is splittet at that point – the new arrays are inserted – and then the rest will be addad afterwards ( Kind of CRISPR for jQuery)
if the ID could not be found – the new array will be inserted as last elements in the slug
The new elements are only input fields for alt and title attribute.
And because the id’s are used ( see code here ) they were inserted in the frontend
_______
For Main Logo
aha it is function-set-avia-frontend.php – and the alt is set to the bloginfo name there is a filter for it but on title it is missing there
Edit : No the filter allready exist – but was on a different place!we can influence the logo by this:
function avf_change_logo_alt($alt) { $alt = "New Alternate Text Here"; return $alt; } add_filter('avf_logo_alt', 'avf_change_logo_alt'); function avf_change_logo_title($title) { $title = "The new Title is here"; return $title; } add_filter('avf_logo_title', 'avf_change_logo_title');
If I should make a decision, I would either go for this manual input solution via register-admin-options.php – or for a filter solution for both logos.
So the attachment alt and title attributes can be used in content – but in this position as logo – we can input a unique texti guess there was something with that filter : avf_hide_transparency_logo_meta
For Now:
i used the id’s from above to insert on that enfold options some input fields to manual insert alt and title attribute :
This comes to child-theme functions.php:function my_transparent_logo_attributes( array $avia_elements = array() ) { $slug = "header"; $id = 'header_replacement_logo'; $new_element_1 = array( "slug" => "header", "name" => __( "Alt for the Transparency Logo", 'avia_framework' ), "desc" => __("Put in your Alt Attribute for Transparency Logo", 'avia_framework'), "id" => "header_replacement_logo_alt", "type" => "text", "std" => "" ); $new_element_2 = array( "slug" => "header", "name" => __( "Title for the Transparency Logo", 'avia_framework' ), "desc" => __("Put in your Title Attribute for Transparency Logo", 'avia_framework'), "id" => "header_replacement_logo_title", "type" => "text", "std" => "" ); $found = false; $index = 0; foreach( $avia_elements as $key => $element ){ $index++; if( isset( $element['id'] ) && ( $element['id'] == $id ) && isset( $element['slug'] ) && ( $element['slug'] == $slug ) ) { $found = true; break;} } if( ! $found ) { $avia_elements[] = $new_element_1 ; $avia_elements[] = $new_element_2 ; } else { $avia_elements = array_merge( array_slice( $avia_elements, 0, $index ), array( $new_element_1, $new_element_2 ), array_slice( $avia_elements, $index ) ); } return $avia_elements; } add_filter( 'avf_option_page_data_init', 'my_transparent_logo_attributes', 10, 1 );
that works – maybe this will be a good way to have here on both logo and alternate logo
is there another way of code here
if the element is not found – it should place the new elements at the end of the header avia_subpage_container
Maybe a mod knows how to set it in better way : but this is academic because the element ( slug and id is found )just for info : besides the image size in the widget areas ( if they are latest news or latest portfolio) – it would take alswas that thumbnail sized image as source – but
there is a filter : avf_newsbox_image_size which can manage that to have another source for that widget thumbnail.
so maybe you like to take instead the square images (180px x 180px) you only had to know what newsbox or portfoliobox you like to select:function my_avf_newsbox_image_size( $image_size, array $args, array $instance ){ if( $args['widget_id'] == ( 'portfoliobox-3' || 'newsbox-2' || 'newsbox-4' ) ){ $image_size = 'square'; } return $image_size; } add_filter( 'avf_newsbox_image_size', 'my_avf_newsbox_image_size', 10, 3 );
i did this before the new filter on having a child-theme : av-helper-masonry.php
and on line 627 i did :$loop_excerpt = $entry->post_excerpt;
but i do agree now it has to work with that new filterwith the code of ismael mentioned here: Link
and my little added selector
the whole sidebar is colorized ( till footer) : ( you have only to adjust the percentage to your enfold width options.
open your Enfold 4.7.3 functions-enfold.php with a good text-editor ( be aware there is in parent enfold folder a functions.php and functions-enfold.php )
( for Mac OS X f.e. sublime-text or on Windows notepad++ )
find
/* AJAX SEARCH */ … rules what you like to influence.
you can replace functions-enfold.php in your parent theme by an edited one – but then the next update will overwrite these changes.That is the great benefit of a child-theme. And – as I mentioned above – these pluggable functions can be replaced by a copy of the content in between.
on line 246ff there is:
if(!function_exists('avia_ajax_search')) { … }
so everything in between this wrapping if clause can be copied and transfered to your child-theme functions.php
on the next update of the parent theme, this will not be lost.The disadvantage is that any changes within this function (in your example it is avia_ajax_search ) are not reflected in the update of the parent theme.
The best would certainly be if there was a hook or filter that you could apply to the content here.
But this must always be already implemented in the theme to be able to use it in the child theme.See here for example the usage of some existing filters to influence search:
https://kriesi.at/documentation/enfold/search/Unfortunately I don’t see ( maybe one of the Mods or Devs ) if you can add the Comment Counts in an easier way. But as you see in my example playground that it works this way.
by the way – you see there are some filters in that function f.e.: avf_ajax_search_function
maybe a mod knows a filter solution for that ?so it is not so easy but because on functions-enfold.php the ajax search function is a “pluggable function” you can have here a child-theme solution. Otherwise you had to have a complete functions-enfold.php in your child.
Every function surrounded by:if(!function_exists('…')){ … }
can be substituted by child-theme function with same name! – because child-theme functions are loaded first – when it comes to the function with the same name in parent theme it does not load the parent function ( because of the if not exists clause)
i have edited that function (on base of enfold 4.7.3) and you can copy & paste that part to your child-theme functions.php
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; 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 = ""; // 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 = ""; // two new lines here $the_id = $post->ID; $commentCount = get_comments_number($the_id); // 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) ); $excerpt .= "<br class='linebreak'/><span>".get_the_time( $search_messages['time_format'], $post->ID )."</span>"; if ( $commentCount != "0" || comments_open($the_id) && $entry->post_type != 'portfolio') { $link_add = $commentCount === "0" ? "#respond" : "#comments"; $text_add = $commentCount === "1" ? __('Comment', 'avia_framework' ) : __('Comments', 'avia_framework' ); $excerpt .= "<span class='sep'> / </span><span>{$commentCount} {$text_add}</span>"; } } else { $excerpt = apply_filters( 'avf_ajax_search_no_excerpt', get_the_time( $search_messages['time_format'], $post->ID ), $post ); if ( $commentCount != "0" || comments_open($the_id) && $entry->post_type != 'portfolio') { $link_add = $commentCount === "0" ? "#respond" : "#comments"; $text_add = $commentCount === "1" ? __('Comment', 'avia_framework' ) : __('Comments', 'avia_framework' ); $excerpt .= "<span class='sep'> / </span><span>{$commentCount} {$text_add}</span>"; } } } $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(); }
because there was a css rule in enfold that sets the breaks in ajax search to display:none
you had to put this in additon to quick css#top #searchform br.linebreak { display: block; }
you can test it here on my playground – put in search : buttons
https://webers-testseite.de/ -
This reply was modified 5 years, 3 months ago by
-
AuthorPosts