Hi, thank you for reaching out to us. We have checked on our end and found the error. The style tag is causing the issue as its placement in the code violates the rules and guidelines of the HTML environment, which is why you are facing this error. Kindly review and adjust the placement of the style tag. Once you make the necessary changes, it should resolve the issue.
Thread Starter
Abid
(@hussain76)
Thanks. What makes me wonder is that in the current version of the feed the only error message is:
Invalid HTML: Named entity expected. Got none.
There is no mention about a style tag anymore (it had been mentioned before).
Are you sure it’s the style tag which is causing the error? If yes, please let me know how to modify the feed’s content (is it done by a wordpress hook?).
Hi, we confirm that the error is being caused by the style tag. Regarding the second error, “Invalid HTML: Named entity expected. Got none,” it is due to the presence of the ” <ins ” tag within the ” <!– Twiago Display Ad Tag —>“. You can verify this in the attached screenshot: https://paste.pics/QBFW3, Check this link also: https://validator.w3.org/feed/check.cgi#l28 You will know the error also. Removing the “<ins> ” tag should resolve the issue. Please implement the suggested changes and recheck. If you still encounter any concerns, feel free to inform us.
-
This reply was modified 2 years, 4 months ago by
GNPublisher.
Thread Starter
Abid
(@hussain76)
Thank you! You write:
Removing the “<ins> ” tag should resolve the issue.
This tag displays an ad banner and is therefore necessary for the “non-feed” version of the page.
So I need to remove this in the CDATA parts of the feed.
Could you give any hint to me how to modify the contents of the feed generated by GN Publisher? Can it be done using a WordPress hook?
Hi, apologies for the delayed response as we are addressing this issue. Please copy the code below and apply it.
add_filter(‘the_content_feed’, ‘gnpub_callback’);”add_filter(‘the_content_feed’, ‘gnpub_callback’);
function gnpub_callback($content){
$content = preg_replace(“//i”,”, $content);
return $content;
}
Once you’ve done so, let us know if it works.
Thread Starter
Abid
(@hussain76)
Sorry, but the code you provided is syntactically wrong and makes no sense 😉
Only thing I got from the code is to make use of ‘the_content_feed’ hook. So I was able to solve the issue:
function gnpub_callback($content) {
$content = preg_replace("/<ins.+?<\/ins>/", "", $content);
$content = preg_replace("/<style.+?<\/style>/", "", $content);
return $content;
}
add_filter('the_content_feed', 'gnpub_callback', 1, 1);
-
This reply was modified 2 years, 4 months ago by
Abid.
-
This reply was modified 2 years, 4 months ago by
Abid.
Hi, sounds great that you got the solution. Actually, we sent the same code, but it accidentally misprinted. Anyways, glad to hear that your issue has been resolved. We’re closing this thread, but if you need any help, please let us know. Have a great day ahead!