• Resolved Patrick_D1985

    (@patrick_d1985)


    Hi there,

    First of; been using your plugin for quite some time.
    Since I started looking into JSON-LD and microdata a while back and its benefits for SEO i wanted to also expand this to Decent Comments and it’s comment display.

    Getting that setup should not be that hard;
    adding this in the class-decent-comments-renderer.php in the for each loop for get_comments should work after the closing div tag.

    /**
    * Custom JSON-LD Addition for comments
    */
    $jsonld_comment_date = get_comment_date(‘c’, $comment->comment_ID);
    $jsonld_comment_title = get_the_title($comment->comment_post_ID);
    $jsonld_comment_link = get_permalink($comment->comment_post_ID);
    $jsonld_comment_discuss_link = get_permalink($comment->comment_post_ID) . ‘#comment-‘ . $comment->comment_ID;
    $jsonld_full_comment = $comment->comment_content;

    $output .= ‘<script type=”application/ld+json”>
    {
    “@context”: “https://schema.org&#8221;,
    “@type”: “Comment”,
    “comment”: “‘ . $jsonld_full_comment . ‘”,
    “text”: “‘ . $jsonld_full_comment . ‘”,
    “datePublished”: “‘ . $jsonld_comment_date . ‘”,
    “author”: “‘ . $comment->comment_author . ‘”,
    “name”: “‘ . $jsonld_comment_title . ‘”,
    “about”: “‘ . $jsonld_comment_title . ‘”,
    “discussionUrl”: “‘ . $jsonld_comment_discuss_link . ‘”,
    “url”: “‘ . $jsonld_comment_link . ‘”
    }
    </script>’;

    Sadly when I try to change anything in regard to class-decent-comments-renderer.php it does not seems to take. For reference I am using the widget though.

    Any help would be greatly appreciated!

    https://www.ads-software.com/plugins/decent-comments/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter Patrick_D1985

    (@patrick_d1985)

    Also adding simple classes to various of the HTML elements does not seem to do anything.
    I have cleared server cache, browser cache , teste with various other browsers etc.

    Also when I make the file class-decent-comments-renderer.php empty but available it still gets its default templating so to speak.

    Hope this helps to clarify the above a bit more.

    Kind regards,
    Patrick Dankers

    Thread Starter Patrick_D1985

    (@patrick_d1985)

    Nevermind it seems to have really been one of those weird weird cache cases where you have tried a zillion things to get it cleared. To realise a day later your changes are now in effect.

    Sorry about the mixup!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘JSON-lD Microdata’ is closed to new replies.