Custom search page


Found a solution myself. Here is what did it for me:

add_filter( 'the_content', 'example_view_post_content' );
function example_view_post_content() {
  echo wp_trim_words( get_the_excerpt(), 15, '...' );
}

I use a lot of custom fields within the articles so maybe that was the reason why the content wasn't clearly displayed. I did a workaround using the excerpt instead.

Sorry for my stupid questions but php and wp dev isn't my strongest area.

Write a reply

Login or register to write a reply, it's free!