- This topic has 7 replies, 2 voices, and was last updated 5 years ago by David.
-
AuthorPosts
-
March 6, 2019 at 5:28 pm #831151Markus
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 pageNow I see Tom has done the WP Show Posts Plugin.
Better to proceed with this?Cheers,
MarkusMarch 7, 2019 at 12:51 am #831339DavidStaffCustomer SupportHi 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?
March 11, 2019 at 7:43 am #835655MarkusHi 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.
March 11, 2019 at 8:20 am #835693DavidStaffCustomer SupportIn 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?
March 11, 2019 at 11:25 am #835857MarkusHi 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
March 11, 2019 at 3:42 pm #836063DavidStaffCustomer SupportSo 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.April 14, 2019 at 10:30 am #868723MarkusAre you happy with our support? Yes, allways the best possible support i can imagine.
The client is online now: https://christianjung.comI 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.
April 14, 2019 at 3:47 pm #868891DavidStaffCustomer SupportAwesome – 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.
-
AuthorPosts
- You must be logged in to reply to this topic.