Forum Replies Created
-
AuthorPosts
-
Ernest Marcinko
KeymasterNeat 🙂 You are welcome!
The code in my previous reply should work with both, just in case you need it.
If you don’t mind, I will close this topic soon and mark it as resolved, feel free to open another one if you have other questions or issues.
If you like the plugin and have not rated already, feel free to leave a rating on your codecanyon downloads page and on the wordpress plugin repository, it’s greatly appreciated.
Ernest Marcinko
KeymasterYou cannot access this content.
Ernest Marcinko
KeymasterI finally had a chance to test, this is the one:
add_filter("asp_query_args", "asp_query_args_change", 10, 2); function asp_query_args_change($args, $search_id) { global $wpdb; if ( $search_id == 1 ) { $include_ids = array(1954, 1955, 1956, 1957, 1958); // Media file IDS to include // No change below $ids = implode(', ', $include_ids); $args['attachment_query']['where'] = "AND $wpdb->posts.ID IN($ids)"; $args['post_in'] = $include_ids; } return $args; }Ernest Marcinko
KeymasterYou are welcome!
1. If the nav bar has any widget or block area, then you could add the plugin shortcode there. Check the theme options or the customizer, sometimes there is a way to add custom shortcodes/texts. If there is none, then you may have to ask the theme developer if there is any way to add shortcodes there. Sometimes the only way to do that is via custom code, they will know which file to edit for the child template.
2. The rating is doable via the
{_wc_average_rating}custom field, use this for better layout:
{_wc_average_rating type="number" decimals=2 decimal_separator="."}For the comments:
Try adding this code via the Code Snippets plugin or to the functions.php file in your theme/child theme directory – make sure to have a full server back-up first for safety. For more details you can check the safe coding guidelines.
add_filter('asp_cpt_advanced_field_value', 'asp_add_comments_number', 10, 3); function asp_add_comments_number($value, $field, $result) { if ( $field == 'post_comments') { return get_comments_number($result->id); } return $value; }After that the plugin will recognize the
{post_comments}pseudo variable and fetch the comments count.Ernest Marcinko
KeymasterYou cannot access this content.
Ernest Marcinko
KeymasterHi,
The errors are reffering to two separate files, of which the first is not plugin related, but the WordPress core.
The second error refers to a line, where is no code executed – which may mean that the memory is already depleeted when the execution gets to Ajax Search Pro. Memory related issues are very hard to debug in wordpress.
To make matters worse, this file is only used when a page is viewed to determine if the plugin assets are required. So it uses almost no memroy whatsoever. Generally the plugin requires very little memory to work.Does this happen on a specific page or in a specific back-end page? Is it possible to replicate the issue?
If not, then there is very likely a memory leak somewhere and the errors were triggered randomly at a point where the actual memory ran out.
Ernest Marcinko
KeymasterYou cannot access this content.
Ernest Marcinko
KeymasterYou are welcome!
I forgot that custom CSS sorry, this will do it:
.asp_w, .asp_w * { font-family: "Open Sans Hebrew" !important; }Ernest Marcinko
KeymasterNevermind, I found some of the customizations, using this custom CSS should get you almost exactly the same layout:
div.asp_m.asp_w { box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2),0 6px 20px 0 rgba(0,0,0,0.19) !important } .rtl .asp_m input.orig { direction: rtl; text-align: right } div.asp_m .probox .proclose svg { background: #fff2f2 !important; fill: rgba(210, 17, 94, 1) !important; } div.asp_m .probox .promagnifier { order: 1 !important; } div.asp_w .probox .proinput input::-webkit-input-placeholder { font-weight: normal; font-family: Open Sans; color: rgba(0,0,0,.6) !important; text-shadow: 0 0 0 rgba(255,255,255,0); } .asp_m .probox { padding: 8px !important; margin: 0 !important; } div.asp_r.vertical { padding: 4px !important; background: #fff !important; border-radius: 3px !important; border: 0 solid #b5b5b5 !important; border-radius: 0 0 0 0 !important; box-shadow: 0 0 3px -1px rgba(0,0,0,.3) !important; } div.asp_r.asp_w.vertical .results .item::after { display: block !important; position: absolute !important; bottom: 0 !important; content: '' !important; height: 1px !important; width: 100% !important; background: #D8D8D8 !important; }Ernest Marcinko
KeymasterI can help you with that. The two plugin are separate so if someone wants they can switch back and forth. Unfortuantely I can’t make it both ways – especially because in the Pro version you can create multiple search bars.
These customizations does not look terribly complicated. I can help you with it if you want to, it should be a matter of minutes only. Let me know if you used any custom CSS and I will help you convert it.
Ernest Marcinko
KeymasterYou cannot access this content.
Ernest Marcinko
KeymasterYou cannot access this content.
Ernest Marcinko
KeymasterSure!
Can you try this variation maybe:
add_filter("asp_query_args", "asp_query_args_change", 10, 2); function asp_query_args_change($args, $search_id) { global $wpdb; if ( $search_id == 1 ) { $include_ids = array(1954, 1955, 1956, 1957, 1958); // Media file IDS to include // No change below $ids = implode(', ', $include_ids); $args['attachment_query']['where'] = "AND $wpdb->posts.ID IN($ids)"; } return $args; }This one has the global database variable request so if that was the issue, then this may change something.
Ernest Marcinko
KeymasterYou cannot access this content.
Ernest Marcinko
KeymasterThe lite version does not have a form name, because in the lite version there is only a single search form, it is not possible to create multiple search bars with it.
Multiple search bars are supported in this Pro version, and because of that a search form name is required. I see you have made an imported search bar already. You can access the settings here: https://i.imgur.com/rnFSTNA.png
Don’t forget to disable Ajax Search Lite – it is best to have only one version active as they share some resources.
-
AuthorPosts