Break WordPress Excerpt Before First or HTML tag

I am trying to understand the the_excerpt(); function in WordPress as I need to show the post content UP UNTIL the first or tag appears inside the post.

There might be 1, 2 or even 10

tags and tags inside the post BEFORE the and/ or tag(s) appear.

Any ideas on how to limit the excerpt based on this?

I’m using, inside the template for single posts, an additional argument for logged in. Basically like this is what I need:

if ( is_user_logged_in() ) {
the_content();
} else {
the_excerpt( $argument_for_breaking_before_first_code_or_pre_tag );
// code here?
}

I hope this makes sense?

Read more here:: or HTML tag" rel=nofollow>Break WordPress Excerpt Before First

 or  HTML tag

Leave a Reply

Your email address will not be published. Required fields are marked *