- This topic has 27 replies, 2 voices, and was last updated 7 years, 8 months ago by Tom.
-
AuthorPosts
-
July 18, 2016 at 9:50 pm #211113Markus
Hi Tom,
maybe this is linked to https://generatepress.com/forums/topic/no-read-more-label-settings-available/
If I do a search I get a result page with exerpts of posts and pages.
Funny, all the pages have a —more— tag in the source.But the do not show the read more… label.
Actually shown is the read more… label only for the pages if the automacally cut. Just after the 55 words which is the value set in the blog Excerpt Length…
Coincidence?
Example: https://insoguide.de/?s=insolvenz
July 18, 2016 at 10:05 pm #211116MarkusFunny, the “blog page” does not cut the posts after 55 words:
https://insoguide.de/newsRegardless of the settings in the blog part of the visual customizer
“Show exerpt” or “Show entire post”.July 19, 2016 at 12:07 am #211142TomLead DeveloperLead DeveloperHi there,
Your blog page seems to be using the More tag, which is why it isn’t cutting off at 55 words.
The search results page is set to display excerpts by default, as search results should really be easy to scan.
Of course, you can make it so the search results show the full post (and respect the more tag) like this: https://generatepress.com/forums/topic/blockquote-and-tables-tags-converting-in-generatepress/#post-148736
Hope this helps ๐
July 19, 2016 at 12:07 am #211143MarkusAlso, the tag page does not cut the pages or post after 55 words:
https://insoguide.de/thema/insolvenzeroeffnungsgrund
(Whereas “thema” is base for all tag pages.)
(I use tags for pages as well).The read more … label is shown in all cases.
By the way:
But it would be nice if the posts and pages would be presented in a masory style.July 19, 2016 at 9:25 pm #211367TomLead DeveloperLead DeveloperLooks like we posted those last two replies at the exact same time!
Is the above resolved? ๐
July 20, 2016 at 9:00 pm #211610MarkusResolved? Yes and no.
Yes: I used the code in your reply
https://generatepress.com/forums/topic/read-more-label-in-search-result-page/#post-211142
which solved my excerpt and read -more- problem.Thank you very much for this!
No: I try again to explain.
My objective is to have almost similiar result pages for:
Searches, e.g. https://insoguide.de?s=insolvenzverschleppung
Blog page: https://insoguide.de/news
and Tag page: https://insoguide.de/thema/insolvenzeroeffnungsgrundAs you see, only the tag page looks different – it would be nice if the posts and pages would be presented in a masory style.
July 20, 2016 at 11:49 pm #211619TomLead DeveloperLead DeveloperInteresting – do you have masonry set to enable through the Customizer, or are you using a function?
July 21, 2016 at 4:18 am #211670Markusjust the cutomizer
July 21, 2016 at 9:02 am #211727TomLead DeveloperLead DeveloperAh it’s because those “posts” are actually pages, and masonry is told not to include pages in masonry.
Are you using a plugin to include pages in your archives?
July 21, 2016 at 9:46 am #211734MarkusHi Tom,
not all of results are pages, some are posts (if they show a date),
as seen in the search example.
In the last example above (tag page) , all are pages. If I add some posts, nothing changes.~~~
I checked the https://wordpress.org/plugins/tag-pages/
Because it contains just two functions, I added those to my child theme’s function.php.
/** * Add the 'post_tag' taxonomy, which is the name of the existing taxonomy * used for tags to the Post type page. Normally in WordPress Pages cannot * be tagged, but this let's WordPress treat Pages just like Posts * and enables the tags metabox so you can add tags to a Page. * NB: This uses the register_taxonomy_for_object_type() function which is only * in WordPress 3 and higher! */ if( ! function_exists('tagpages_register_taxonomy') ){ function tagpages_register_taxonomy() { register_taxonomy_for_object_type('post_tag', 'page'); } add_action('admin_init', 'tagpages_register_taxonomy'); } /** * Display all post_types on the tags archive page. This forces WordPress to * show tagged Pages together with tagged Posts. Thanks to Page Tagger by * Ramesh Nair: http://wordpress.org/extend/plugins/page-tagger/ */ if( ! function_exists('tagpages_display_tagged_pages_archive') ){ function tagpages_display_tagged_pages_archive(&$query) { if ( !is_admin() && $query->is_archive && $query->is_tag ) { $q = &$query->query_vars; $q['post_type'] = 'any'; } } add_action('pre_get_posts', 'tagpages_display_tagged_pages_archive'); } ?>
July 21, 2016 at 10:00 am #211735MarkusThen I used your GP Hooks to display the tags.
This alltogether took me two nights.
You have to understand, this is my first WP Website – and I am not a developer.Thanks again for all your support.
July 21, 2016 at 10:19 am #211743MarkusIn case you need it: this I used to display the tags on pages.
<?php if ('page' == get_post_type() and has_tag()): ?> <footer class="entry-meta"> <span class="tags-links"><span class="screen-reader-text">Tags </span> <?php the_tags(' ', ', ', '<br />'); ?> </span> </footer> <?php endif; ?>
July 21, 2016 at 7:53 pm #211863TomLead DeveloperLead DeveloperIf you remove the functions here: https://generatepress.com/forums/topic/read-more-label-in-search-result-page/#post-211734
Does masonry work on the tag pages?
July 22, 2016 at 7:21 am #211953MarkusIf I remove then, it does mansonry, but show no pages anymore…
July 22, 2016 at 11:56 pm #212153TomLead DeveloperLead DeveloperHmm, interesting problem indeed.
No idea if it will work or not, but try this:
add_filter( 'generate_blog_masonry','generate_custom_masonry' ); function generate_custom_masonry() { if ( is_tag() ) return 'true'; return $masonry; }
-
AuthorPosts
- You must be logged in to reply to this topic.