WordPress the_excerpt without tags

Use the_excerpt without tags

Sooner or later, by using the_excerpt arise a number of challenges and questions. For example, in the some cases in the start of post should be used headers or any other tags (<strong>, <em>, etc) in this case, the_excerpt function, also output these tags in excerpt. It looks not good, moreover, quite often question arises as to remove not only tags, but also these tags content too.

Use the_excerpt two different the_excerpts for one post

Next task is not typical but more specific. Is it possible used two different the_excerpts for one post? The first, used for generation and outputting text in the tag <meta name="description" ...> that is this excerpt is intended more for search systems, than for users, although recent cans see it in the search results. The second excerpt, is intended for showing on a page as a post preview and more visitor oriented. Such an approach enough comfy, because provide create diverse content and more multilateral describe issue of article.

More one task. This time already from aesthetics area :) In the one of previous post we considered examples of used the_excerpt. Practical of each project there is a need to change quantity words of excerpt and end of excerpt. In terms of a clean code, it would be good implement all articulated by demands in one function, so that in future use it in each project. Below is solution such a task:

Leave Comment

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