solosimar
Forum Replies Created
-
It just changes the order in which the search results fields are showed. Instead of “text I wrote on mycustomfield1 field_55eedc91644aee text I wrote on mycustomfield2” I get something like “field_55eedc91644aee text I wrote on mycustomfield1 text I wrote on mycustomfield2”.
Do you think this may have something to do with the WordPress version? I’m running 4.3 and both Advanced Custom Fields and Relevanssi plugins are compatible up to 4.2.4…Mikko, I’ve just tried in a WP fresh install, and I’m getting the same results…
With
add_filter('relevanssi_excerpt_content', 'excerpt_function', 10, 3); function excerpt_function($content, $post, $query) { global $wpdb; $fields = $wpdb->get_col("SELECT DISTINCT(meta_key) FROM $wpdb->postmeta"); foreach($fields as $key => $field){ $field_value = get_post_meta($post->ID, $field, TRUE); $content .= "" . ( is_array($field_value) ? implode('', $field_value) : $field_value ); } return $content; }the search results excerpts show me something like “text I wrote on mycustomfield1 field_55eedc91644aee text I wrote on mycustomfield2”.
I get this no matter what I have in Relevanssi settings, under Indexing options > Custom fields to index (all / visible / mycustomfield1,mycustomfield2).
With
add_filter('relevanssi_excerpt_content', 'excerpt_function', 10, 3); function excerpt_function($content, $post, $query) { $fields = array('mycustomfield1','mycustomfield2'); foreach($fields as $key => $field){ $field_value = get_post_meta($post->ID, $field, TRUE); $content .= ' ' . $field_title[$key] . ' ' . ( is_array($field_value) ? implode(' ', $field_value) : $field_value ); } return $content; }the search results excerpts show me something like “text I wrote on mycustomfield1 text I wrote on mycustomfield2”, which is I what I’m looking for… but without the need to write ALL my custom fields in
$fields = array('mycustomfield1','mycustomfield2');.Do you have any other suggestions…? I’m using a child theme of the Cyberchimps Responsive theme (http://cyberchimps.com/responsive-theme/), if it helps.
Hi Mikko, thanks for your reply.
The problem is I have a great number of ACF custom fields and didn’t want to write all of them by hand, having to update the list whenever I created a new custom field… That’s why I was usingglobal $wpdb; $fields = $wpdb->get_col("SELECT DISTINCT(meta_key) FROM $wpdb->postmeta");instead of
get_post_meta($post->ID, 'fieldname', true);
But withglobal $wpdb;, the search results are giving me not only the content of what is stored in the ACF custom fields but also the ACF custom field label itself (along with other unwanted stuff).
I may have missed something or have some misconfiguration somewhere, but I cant’ figure out what 🙁I have site A in server 1. In that site, I had the fatal error when I tried to activate the plugin; I updated the php version and was able to activate the plugin but unable to make it work.
I then created site B on server 1; I tried several php versions but was unable to make the plugin work.
I went to server 2 and created site C. Here, all worked ok from scratch.
I then went back to server 1 and created site D, with all the plugins I have in site A (just to see if there were any plugin compatibility issues). I did not change the php version (it’s now running 5.4) and the plugin works.
In site A (my primary site), hosted in server 1, it still doesn’t work, no matter what I do. My guess goes to something related to that initial fatal error during activation 🙁Andreas,
After a lot of testing… I’m unable to find out the problem 🙁 Server date/time is correct and wp cron jobs are running properly. I did another fresh install, in the same server, with all the plugins I had on my other site and Post Status Scheduler worked.
I’m guessing the fatal error I had during install (https://ww.wp.xz.cn/support/topic/fatal-error-when-activating-plugin-17?replies=7) somehow corrupted something. Uninstalling and installing Post Status Scheduler doesn’t change anything 🙁
You said the plugin registers a cron job… Uninstalling the plugin “unregisters” that cron job? Are there any database changes?Forum: Plugins
In reply to: [Post Status Scheduler] Fatal error when activating pluginWith no warranties… I would give a try with 5.4 🙂
Andreas, I tried on a fresh WP install in the same server and the plugin still doesn’t work. I then tried on another hosting company and it worked. So it does seem it’s something related to the server. Are there any special requirements to get this up and running?
Forum: Plugins
In reply to: [Post Status Scheduler] Fatal error when activating pluginSajid, I checked the php settings of my hosting service (if you have Cpanel, go to Software and Services > Select PHP version and choose the most recent one available). Hope that helps!
Hi,
The server time is correct (I even echoed it through php to check out). And when I’m scheduling a page, the plugin doesn’t allow me to set a date/time prior to current date/time, so I think that part is working.Forum: Plugins
In reply to: [Post Status Scheduler] Fatal error when activating pluginHi again!
Never mind, I discovered it was happening due to the php version I was using… my bad 🙂Forum: Plugins
In reply to: [Query Wrangler] orderby -> meta_value+1 (also looking for sorting through an advanced custom field)
Forum: Plugins
In reply to: [Query Wrangler] How to sort by custom field?Hey Jonathan,
That would be great, thanks!Forum: Plugins
In reply to: [Easy Testimonials] Not working in homepageHi Richard,
Yes, unfortunately there’s a conflict with Cycle2… I’ll check with my client if he is willing to let go of NextGEN Slideshow.
Thank you for your time.Forum: Plugins
In reply to: [Easy Testimonials] Translation?Hey Richard!
Thank you for your time! The easiest and most friendly way I think it would be having an options page similar to the ones that custom post type generators plugins usually have, with the labels in the original language and a text box to translate/change their names 🙂Forum: Plugins
In reply to: [Easy Testimonials] Not working in homepageOk, I discovered what was stopping Easy Testimonials from working properly… I have a NextGEN Slideshow on my homepage 🙁 If I disable it, the testimonials random and cycle normally…
How can I solve this conflict? I have to maintain the NextGEN Slideshow and I would really like to have Easy Testimonials at the same time…