Style tag content shows in description

Post Reply
Sergelie
Sr. Bludit
Posts: 32
Joined: Sun Feb 14, 2021 3:19 pm
Has thanked: 6 times
Been thanked: 4 times
Contact:

Code: Select all

<div class="entry-summary">
<?php if(strlen($page->description())>0 ){
echo html_entity_decode($page->description()); // Sergelie added ..entity... }
else{
echo html_entity_decode($helper->content2excerpt($page->content(false)));
// sergelie added ...entity... }
?>
</div>
This is the code to print description on the main page (home.php).

If I enter some style in a style tag in the head of a post, the content of the tag (ex. p {color:red;} shows at the top of the description.

Is there a way to prevent this (I try to avoid having to recopy the description in the specific space provided).

Thanks for your help,

Sergelie
User avatar
Edi
Site Admin
Posts: 3121
Joined: Sun Aug 09, 2015 5:01 pm
Location: Zurich
Has thanked: 54 times
Been thanked: 77 times
Contact:

Sorry, I cannot follow you... Can you please show an example.
Clickwork - Websites mit Bludit | Planet Bludit - Tipps und Snippets
Post Reply