Half working, but fixed…
-
Hello!
I don’t need any help, to solve my problems, because i solved all of what i have found!
The owner doesn’t support this plugin, not replying for the tickets…This plugin is not well tested and I spent hours to make it work like it should be…
With just installing it, it’s only capable of adding FAQs to the posts. If you edit the wp-content/plugins/faq-schema-markup-faq-structured-data/schema-for-faqs.php in line 72 and change this
'post',
to:
$post_type,
and it will appear on the pages as well.If you work with not english language, like hunagrian or other utf8 related stuff, you need to modify replace this:
$script_string = json_encode($scrdata);
to this:
$script_string = json_encode($scrdata, JSON_UNESCAPED_UNICODE);
in line 47 and this:
$ques_ans_string=json_encode($ques_ans_data);
to this:
$ques_ans_string=json_encode($ques_ans_data, JSON_UNESCAPED_UNICODE);
in line 171.To prevent Google errors, you need to modify at line 45-50 from this:
$script_string = json_encode($scrdata, JSON_UNESCAPED_UNICODE); ?> <script type="application/ld+json">{"@context":"https://schema.org","@type":"FAQPage","mainEntity":<?php echo $script_string; ?>}</script> <?php
to this:
if(!empty($scrdata)) { $script_string = json_encode($scrdata, JSON_UNESCAPED_UNICODE); ?> <script type="application/ld+json">{"@context":"https://schema.org","@type":"FAQPage","mainEntity":<?php echo $script_string; ?>}</script> <?php }
And last of all, this code quality is not the best… Checking for post type 2 different ways, code formating is almost horrible… You need to spend some hours to make it a little better…
- The topic ‘Half working, but fixed…’ is closed to new replies.