Archived topic
Individual Design for Post Listings on Blog Page, Archive Pages
7 replies · Started by Markus on March 6, 2019
Hello Vancouver.
I need just a hint, if this goes in the right direction.
Client wants a very special post list on start- category- tag-pages.

As you see on the website url, the design is done.
A hint in the forum recommended using the display posts plugin.
So I created a start page and category page (Photographs) with the help of the great new GP elements and the put the display posts shortcut in.
Obviously this has 2 flaws:
+ not possible (for me?) to add any kind of pagination or infinite scroll
+ not possible (for me?) to build a generic template for any tag page
Now I see Tom has done the WP Show Posts Plugin.
Better to proceed with this?
Cheers,
Markus
Hi there,
WP Show Posts is a great plugin and yes could do both for you, the archive (tag) template would take a little bit of code to do. Which means i would need to pack you off to the WP Show Posts support :)
Before doing that, whats stopping your from using the GP Blog to do this?
Hi David,
thank you for the fast reply. World-class service, as always.
whats stopping your from using the GP Blog to do this?
The layout of the post list.
Client wants something like this (see image above).
POST DATE
(the post-title in bold typo + mid-dot + post excerpt in one line.
In that case either the WP Show Posts plugin or the GP Blog would need some code to filter the_excerpt to include the post title.
Is it an manual (custom) excerpt or the auto generated excerpt being used?
Hi David,
it's a manual exerpt.
By combining trough filter, how is it possible to give those elements a diffent style?
Thank you for the help.
Markus
So we could do something like this:
remove_filter( 'the_excerpt', 'wpautop' );
function excerpt_incl_post_title( $excerpt ) {
$id = get_the_ID();
if ( has_excerpt( $post->ID ) ) {
$excerpt = sprintf( '<span class="custom-post-title">%1$s <span class="mid-dot">·</span> </span><p class="custom-post-excerpt"> %2$s</p>',
esc_html(get_the_title($id)),
$excerpt);
}
return $excerpt;
}
add_filter( 'get_the_excerpt', 'excerpt_incl_post_title' );
Then this CSS:
.custom-post-title, .custom-post-excerpt {
display: inline;
}
Then you can use the mid-dot class to style that.
Are you happy with our support? Yes, allways the best possible support i can imagine.
The client is online now: https://christianjung.com
I used a differrent solution for the output using the Display Post Plugin Display Posts Output Filter
https://displayposts.com/docs/the-output-filter/
<php
function mz_dps_output_customization( $output, $original_atts, $image, $title, $date, $excerpt, $inner_wrapper, $content, $class, $author, $category_display_text ) {
$output = '<' . $inner_wrapper . ' class="' . implode( ' ', $class ) . '">' . $image . '<div class="date">' . $date . '</div>' . $title . ' · '. $author . $category_display_text . $excerpt . $content . '</' . $inner_wrapper . '>';
return $output;
}
add_filter( 'display_posts_shortcode_output', 'mz_dps_output_customization', 10, 11 );
The client is fine, he even gave you credit on the about page: https://www.christianjung.com/about/
For me, I am still wondering how to modify the tag-pages - just a hint where to start is fine.
Awesome - really glad you're enjoying the Theme and the support.
Does the Function i provided not do the trick for the tag archives? Let me know.