- This topic has 5 replies, 2 voices, and was last updated 4 years ago by
Tom.
-
AuthorPosts
-
February 27, 2019 at 6:01 am #823201
Francesco
Hello there,
I would love to add Comments and Review Stars to a page built with sections. (looks like that works only without sections active)
Comments at the end of the page.
User Review Stars on top of the contents.The page (via Rank Math seo plugin) is marked on schema markup as “article”, I’ve already switched to “review” but nothing has changed.
How can I add these two things in the cleanest and effective way?
Thanks for your support.[the page I’m referring is the home page]
GP Premium 1.7.8February 27, 2019 at 5:16 pm #823914Tom
Lead DeveloperLead DeveloperHi there,
Sections by default were never built to include comments or any sort of automatically placed content. The reason is that those items don’t know which Section to add themselves to.
There is a potential solution here: https://generatepress.com/forums/topic/comments-using-sections/#post-325331
How did you switch the schema to reviews? Are you wanting to only change it on this one page?
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentFebruary 28, 2019 at 12:53 pm #824928Francesco
Hi Tom,
thanks for your explanation, I have switched to a page without section, now comments load as expected!1.
Regards schema data “review stars” I have tried 2 different plugins: one is “Rank Math” seo plugin the other is “Schema & Structured Data for WP” BUT both show me only editors rating.
Replying at your question: yes at this stage I would love to add only to this specific page (but if there is a viable solution is ok also to the entire site)
I’m looking for a solution where users can rate the article[page] and assign stars based on their preference. My goal is to display reviews stars inside Google serp snippet. (and if I’m not wrong the solution is by schema micro-data).2.
I’m also looking to display, in the beginning of the page, the standard “date” and “author name” info. Is there a way to display also on pages instead of articles (where are displayed by default).Thanks for your support.
FrancescoFebruary 28, 2019 at 5:33 pm #825096Tom
Lead DeveloperLead Developer1. You could try this function:
add_filter( 'generate_article_itemtype', function( $type ) { return 'Review'; } );
However, changing the itemtype like this might review you to make some other adjustments to the content/HTML.
2. Give this a shot:
add_filter( 'generate_entry_meta_post_types', function( $types ) { $types[] = 'page'; return $types; } );
Let me know 🙂
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentMarch 1, 2019 at 12:00 am #825252Francesco
I have added both via snippet plugin …but seems not working…
maybe I need to add in other way…is not clear in my mind…
thanksMarch 1, 2019 at 8:48 am #825764Tom
Lead DeveloperLead DeveloperHmm, try this instead:
add_action( 'after_setup_theme', function() { add_filter( 'generate_article_itemtype', function( $type ) { return 'Review'; } ); add_filter( 'generate_entry_meta_post_types', function( $types ) { $types[] = 'page'; return $types; } ); } );
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-development -
AuthorPosts
- You must be logged in to reply to this topic.