-
Author
-
October 10, 2017 at 18:16 #176241ScorpyonsParticipant
Hi,
How do I change snippets/schema.org tags in the pages?
October 11, 2017 at 14:39 #176325LauraModeratorHello, will assign the ticket to a higher support level who can help and advise you in your query.
Thanks! ?Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionLaura Solanes - Graphic Designer and Web Designer
Please be patient as I try to answer each topic as fast as i can.
If you like the theme or the support you've received please consider leaving us a review on Themeforest!
Always happy to help you đ
October 12, 2017 at 14:58 #176439RaduModeratorHere it’s our function for the schema.org, paste it to child theme and change it as you need.
COPY CODE/* Schema org for body */ if ( ! function_exists( 'kleo_get_schema_org_markup' ) ) { function kleo_get_schema_org_markup() { $schema = 'http://schema.org/'; if ( is_singular( 'post' ) ) { $type = "Article"; } elseif ( is_singular( 'portfolio' ) ) { $type = "VisualArtwork"; } else { if ( is_author() ) { $type = 'ProfilePage'; } // Is search results page elseif ( is_search() ) { $type = 'SearchResultsPage'; } else { $type = 'WebPage'; } } $type = apply_filters( 'kleo_schema_org_type', $type ); return 'itemscope itemtype="' . $schema . $type . '"'; } } function kleo_schema_org_markup() { echo kleo_get_schema_org_markup(); }
The function needs to be pasted in wp-content/themes/kleo-child/functions.php
NOTE : Child theme needs to be installed and activated.
Cheers
RHi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionOctober 13, 2017 at 09:31 #176516ScorpyonsParticipantHi,
I followed the instructions, but when I inserted the code in wp-content/themes/kleo-child/functions.php, when I access the site a get the following error message: Fatal error: Cannot redeclare kleo_schema_org_markup() (previously declared in /home/masteraquaristz/aquaristz.com/wp-content/themes/kleo-child/functions.php:56) in /home/masteraquaristz/aquaristz.com/wp-content/themes/kleo/lib/theme-functions.php on line 2522
Here is a screenshot of the issue:
https://gyazo.com/7f101ab624ea11495f0104cc8122f318I reverted the change for now.
Can you help me?
October 13, 2017 at 17:23 #176551RaduModeratorHi,
In this case add only this code
COPY CODE/* Schema org for body */ if ( ! function_exists( 'kleo_get_schema_org_markup' ) ) { function kleo_get_schema_org_markup() { $schema = 'http://schema.org/'; if ( is_singular( 'post' ) ) { $type = "Article"; } elseif ( is_singular( 'portfolio' ) ) { $type = "VisualArtwork"; } else { if ( is_author() ) { $type = 'ProfilePage'; } // Is search results page elseif ( is_search() ) { $type = 'SearchResultsPage'; } else { $type = 'WebPage'; } } $type = apply_filters( 'kleo_schema_org_type', $type ); return 'itemscope itemtype="' . $schema . $type . '"'; } }
Let me know
Cheers
R.Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionOctober 13, 2017 at 19:40 #176566ScorpyonsParticipantHi,
It seems that most of the pages are working now.
I don’t see any changes on the profile page. If you access any profile page (https://www.aquaristz.com/membros/raphael-martins/profile/), you don’t see ProfilePage type. Can you help me with this?
Also, how can I include itemtype=”http://schema.org/DiscussionForumPosting” to the forum?
October 16, 2017 at 15:12 #176847RaduModeratorHi,
Replace with this one
COPY CODE/* Schema org for body */ if ( ! function_exists( 'kleo_get_schema_org_markup' ) ) { function kleo_get_schema_org_markup() { $schema = 'http://schema.org/'; if ( is_singular( 'post' ) ) { $type = "Article"; } elseif ( is_singular( 'portfolio' ) ) { $type = "VisualArtwork"; } else if (bp_is_user()) { $type = 'ProfilePage'; } else { if ( is_author() ) { $type = 'ProfilePage'; } // Is search results page elseif ( is_search() ) { $type = 'SearchResultsPage'; } else { $type = 'WebPage'; } } $type = apply_filters( 'kleo_schema_org_type', $type ); return 'itemscope itemtype="' . $schema . $type . '"'; } }
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionOctober 17, 2017 at 15:00 #176952ScorpyonsParticipantHi,
it’s working now! Regarding Forum, how can I include itemtype=âDiscussionForumPostingâ to the forum?
Should I include something like this?
elseif ( is_singular( ‘forum’ ) ) {
$type = “DiscussionForumPosting”;Is this correct or should I code something else?
October 17, 2017 at 18:38 #176974RaduModeratorHi,
Yes exactly,
Did you have any other suggestions to make the snippet to cover more components at once.
Cheers
R.Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionOctober 17, 2017 at 20:02 #176981ScorpyonsParticipantHi Radu, Thanks for your response.
I have few familiarity with PHP, so sorry for my stupid questions. Just to confirm, for foruns, should we use:
elseif ( is_singular( âforumâ ) ) {
or
elseif ( is_bbpress() ) {
which should I use? Also, I do have suggestions that you guys can include in seventhqueen/schema-org-body-header.php.
You guys could include this forum improvment, and since the theme is multipurpose, you guys could also include schema.org tags related to places (Geodirectory), tags related to contact page (http://schema.org/ContactPage).
These changes would make the theme much more complete.
Regards,
October 18, 2017 at 16:59 #177045RaduModeratorHi,
For the forums just use the next function https://pastebin.com/raw/7Vz4wCDV
For the contact page use the next snippet https://pastebin.com/raw/7bgqRbBK
The function needs to be pasted in wp-content/themes/kleo-child/functions.php
NOTE : Child theme needs to be installed and activated.
That’s it, the bbPress will be included in next theme update, for the contact page you will have to add the code.
Cheers
R.Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution -
AuthorPosts
The forum ‘General questions’ is closed to new topics and replies.