Forum Replies Created

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter mdrick

    (@wicko77)

    It’s perfect. It works very well. Thank you to have taken the time to answer and find a solution.

    I have 0 or 1 that appear at the beginning of some excerpt. Could it be because of true/false custom fields?

    Thread Starter mdrick

    (@wicko77)

    For an agenda I created two custom date fields with ACF.
    A start date event_hour_start (datepicker) and an end date event_hour_end (datepicker).

    If I use the some option or visible I don’t have any excerpts.

    When I use relevanssi_excerpt_content hook it works but I don’t have fields in flexible content, I tried to use blocs_article_$_article_wysiwyg and blocs_article_%_article_wysiwyg syntax without success. Maybe I need to reindex when I change options?

    If I disable Relevanssi custom excerpts (I uncheck Create custom search result snippets). I no longer have the dates (and obviously no longer any excerpt).

    • This reply was modified 4 years, 4 months ago by mdrick.
    • This reply was modified 4 years, 4 months ago by mdrick.
    • This reply was modified 4 years, 4 months ago by mdrick.
    • This reply was modified 4 years, 4 months ago by mdrick.
    • This reply was modified 4 years, 4 months ago by mdrick.
    Thread Starter mdrick

    (@wicko77)

    Thank you for taking the time to explain this to me.

    I’m a little confused.

    What is your advice for building an excerpt with only selected custom fields (in addition to the_content from WordPress).

    I tried to set Custom fields option to some in indexing tab but I still have results with custom fields that I don’t want.

    I tried to set Custom fields to visible and I have these famous date fields that appear in the excerpt.

    • This reply was modified 4 years, 5 months ago by mdrick.
    Thread Starter mdrick

    (@wicko77)

    Hello thank you very much for your answer.

    If I declare custom fields with relevanssi_excerpt_custom_field_content hook, only these fields will be used ?

    I don’t have more detail about this hook in the documentation. What parameters does this hook accept?

    What’s the difference with relevanssi_excerpt_content ?

    function custom_fields_to_excerpts($content, $post, $query) {
    	$custom_field = get_post_meta($post->ID, 'article_technics_repeater', true);
        $content .= " " . $custom_field;
        $custom_field = get_post_meta($post->ID, 'article_wysiwyg', true);
        $content .= " " . $custom_field;
        return $content;
    }
    
    add_filter('relevanssi_excerpt_content', 'custom_fields_to_excerpts', 10, 3);

    It is possible to hide link in content. I got https://www.soundcloud.com… for example ?

    Thank you in advance

    • This reply was modified 4 years, 5 months ago by mdrick.
    • This reply was modified 4 years, 5 months ago by mdrick.
    • This reply was modified 4 years, 5 months ago by mdrick.
    • This reply was modified 4 years, 5 months ago by mdrick.
    • This reply was modified 4 years, 5 months ago by mdrick.
    • This reply was modified 4 years, 5 months ago by mdrick.
Viewing 4 replies - 1 through 4 (of 4 total)