Skip to main content
added 535 characters in body
Source Link

I want to show some of the content for eachhave 25+ posts as a preview inthat are all structured the content archive (like a portfolio grid).same way, The contents lookthe content is like this:

<ul class="foo">
<li>b</li>
<li>a</li>
<li>r</li>
</ul>
<p>lorem ipsum...</p>
<img></img>

they serve as single portfolio objects.

I want to show some of the content for each posts as a preview in the content-archive.php (like a portfolio grid). It works as far as that I have each post previewed with it's title, header picture etc. (things I can retrieve from WP), but I can either only display an excerpt (which looks bad, since each post starts with a list) or the whole post (which is a bloat and looks bad as well).

The the_expcerpt() function won't do, because I want it displayed like a list, the the_content() won't do because I want to lose the rest.

I only know that each and every posts starts with a <ul> with 3 or 4 <li> lements which are variable in length. Those I wan't to display, nothing more, nothing less

So my guess is to filter the the_content with a regular expression and display only the list elements?

I want to show some of the content for each posts as a preview in the content archive (like a portfolio grid). The contents look like this:

<ul class="foo">
<li>b</li>
<li>a</li>
<li>r</li>
</ul>
<p>lorem ipsum...</p>
<img></img>

The the_expcerpt() function won't do, because I want it displayed like a list, the the_content() won't do because I want to lose the rest.

So my guess is to filter the the_content with a regular expression and display only the list elements?

I have 25+ posts that are all structured the same way, the content is like this:

<ul class="foo">
<li>b</li>
<li>a</li>
<li>r</li>
</ul>
<p>lorem ipsum...</p>
<img></img>

they serve as single portfolio objects.

I want to show some of the content for each posts as a preview in the content-archive.php (like a portfolio grid). It works as far as that I have each post previewed with it's title, header picture etc. (things I can retrieve from WP), but I can either only display an excerpt (which looks bad, since each post starts with a list) or the whole post (which is a bloat and looks bad as well).

The the_expcerpt() function won't do, because I want it displayed like a list, the the_content() won't do because I want to lose the rest.

I only know that each and every posts starts with a <ul> with 3 or 4 <li> lements which are variable in length. Those I wan't to display, nothing more, nothing less

So my guess is to filter the the_content with a regular expression and display only the list elements?

Source Link

Return only certain (html)-elements of the_content()

I want to show some of the content for each posts as a preview in the content archive (like a portfolio grid). The contents look like this:

<ul class="foo">
<li>b</li>
<li>a</li>
<li>r</li>
</ul>
<p>lorem ipsum...</p>
<img></img>

The the_expcerpt() function won't do, because I want it displayed like a list, the the_content() won't do because I want to lose the rest.

So my guess is to filter the the_content with a regular expression and display only the list elements?